How do i change the timestamp of a file in linux only if it already exists?
shoebill last edited by petulia3478
-c, --no-create do not create any files
If a file already exists for example.
$ ls -l afile -rw-r--r-- 1 training training 0 Jun 3 06:13 afile
Then running the touch command with the
-coption will update the timestamp.
$ touch -c afile $ ls -l -rw-r--r-- 1 training training 0 Jun 7 10:20 afile
© Lightnetics 2020