How to hack to change the created and modified date of a file

We can do this trick with a single terminal command.

first dive into the directory where the file is stored.
touch -t YYYYMMDDhhmmss fileName.extension

Done, if the time you entered is before the original created time, both created and modified time would be changed to the new time assigned. However, if the time you entered is after the original created time, only the modified time would be affected.

eg. There is a file, test.doc, on your Desktop.
1. Launch Terminal in Applications/Utilities/Terminal.app
2. type in cd ~/Desktop
3. type in touch -t 20130118235533 test.doc
Now the test.c’s last modified time is updated to year 2013, Jan 18th, 23:55:33.

Leave a Reply