シンボリックリンクのタイムスタンプの変更

シンボリックリンクのタイムスタンプの変更

一般ファイルのタイムスタンプを変更する方法を知っています。

touch -t 201301291810 myfile.txt

シンボリックリンクを使用して同じことを行うことはできません。可能ですか?

リリース: RHEL 5.8

ベストアンサー1

スイッチの追加 -h

touch -h -t 201301291810 myfile.txt

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

おすすめ記事