投げ銭

★当サイトへの投げ銭(PayPal)★

LINK


(無償、寄付歓迎) logo
世界中で使われるISO標準オフィスソフト(MSオフィス互換)

★LibreOfficeの導入事例★
詳細について

人気の投稿(1ヶ月間)

Ad

Ad

投げ銭

★当サイトへの投げ銭(PayPal)★

2016年6月14日火曜日

【Linux CentOS 6.7】ファイルのタイムスタンプを変更する方法

次のようにすると、ファイルのタイムスタンプを任意に書き換えられる。
# touch -a -m -t 201606140001 target
上の例は、targetというファイルについて、
アクセス日時、変更日時を、共に、2016年06月14日 00時01分 に書き換えるコマンドである。


下記、touch --help の引用である。
Mandatory arguments to long options are mandatory for short options too.
  -a                     change only the access time
  -c, --no-create        do not create any files
  -d, --date=STRING      parse STRING and use it instead of current time
  -f                     (ignored)
  -h, --no-dereference   affect each symbolic link instead of any referenced
                         file (useful only on systems that can change the
                         timestamps of a symlink)
  -m                     change only the modification time
  -r, --reference=FILE   use this file's times instead of current time
  -t STAMP               use [[CC]YY]MMDDhhmm[.ss] instead of current time
  --time=WORD            change the specified time:
                           WORD is access, atime, or use: equivalent to -a
                           WORD is modify or mtime: equivalent to -m

<参考>
・ How can I change the date modified/created of a file?
< http://askubuntu.com/questions/62492/how-can-i-change-the-date-modified-created-of-a-file > 2016年6月14日

投げ銭

★当サイトへの投げ銭(PayPal)★

Ad

Ad