Back Date A File Using Terminal 1
Trick
Hey
This is quite a fun or useful trick which you can use to change the date of any file or folder. Its useful if you need to previously date a file for what ever reason, you can also date something in the future if needs be. This trick, like most on this site, using Terminal. You need to be a little bit proficient using Terminal with this trick otherwise you could screw things up.
Open Terminal. This trick is a one liner and takes the following syntax
touch -t 20090101050202 /location/of/file/filename.png
The first part of the file is pretty obvious, we are using the touch command which is really useful and is designed to change file access and modification times. The next part of it is the number, this is the date of the file in reverse order. 20090101050202 = YYYYMMDDhhmmss, year month day hour minute second. You can omit the seconds section, you really don’t need it.
Once as you hit return and everything is done correctly the file access time will have change to what you have imputed.
In the future I will be going through the touch command more, as it is a quite useful.
Where To Next?
One Response to “Back Date A File Using Terminal”
-
1
Hi James, this little trick worked wonders for me. In iMovie09 some clips were in the wrong order within their event, and with your help I changed the date of the video files, restarted iMovie and bingo! Thanks
Comment By Joachim on July 2nd, at 12:27 pm