How do you modify a file without changing the timestamp in Unix?

How do you modify a file without changing the timestamp in Unix?
Answer
The option -r (or –reference) uses file’s time instead of current time. You can use stat to check the timestamps of both files. Now edit the main file and make desired changes. Then use the
touch
command to touch the main file with timestamp of tmp file.
 

Tìm kiếm

Back
Top