Assume there’s a file @ /home/user/testmsg.txt
If you want to change the file timestamp to 09/20/2011 08:30 using touch command, here’s how you can do it:
# Only change the last accessed time touch -t -a 20110920083000 /home/user/testmsg.txt # Only change the last modified time touch -t -m 20110920083000 /home/user/testmsg.txt # Change both the times - modified and accessed times touch -t 20110920083000 /home/user/testmsg.txt
From Wikipedia,
touch is a standard Unix program used to change a file‘s access and modification timestamps. It is also used to create a new empty file.
Related articles
- Some examples of grep command in unix (javarevisited.wordpress.com)
- Commands to Compare Files in Linux (brighthub.com)
- Learning Unix (tirania.org)
Advertisements
Thanks for this good summary. Is this not a security issue. How can I search the file system to see what files have changed if a hacker can modify the PHP files and simply touch the date back to the original value?