LoginSignup
2
2

More than 5 years have passed since last update.

ファイルの最終更新日時を変更する方法(UNIXコマンド)

Posted at

ファイルの最終更新日時を変更する方法(UNIXコマンド)

UNIXコマンドでファイルの最終更新日時を変更する方法をメモ。

ファイルの最終更新日時を使用してファイル削除を行う処理等の検証を行う時等に便利。

■実行方法

コマンドラインで以下コマンドを実行することで変更が可能。

touch -t yyyyMMddhhmm [ファイル名]

例)ファイルの更新日時を2014年01月01日12時30分に変更する場合

touch -t 201401011230 sample.log

以上参考まで。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2