Wednesday, April 11, 2007

Change Access and Modification Times on a File

If you ever needed to arbitrarily change the access and modification times on a file, here's how to do it. I can see this being useful when you are performing a find event. You can also use a reference file to set the times on a target file or directory.

Here's the time set to Apr 10, 2007 18:16 (6:16pm)
#touch -t 200704101816 filename

#settime -f reference_file target_filename

No comments: