Sunday, April 21, 2013

osx: change a bunch of file dates (like for iphoto)

So I think I'm finally ready to switch to OSX for my main home machine. I'm finding the switch harder than I expected in some ways: in particular, it's hard enough to get iTunes to recognize ratings and playlists from another machine, and "date added" seems well-nigh impossible.

I'm taking a breather from that, though, to get my iPhotos in order, switching from my old organization of "folder of year, lots of subfolders by month (or season)". Actually, iPhoto would do really clever things for grouping photos by "event date", but because of another computer mishap of mine, every photo before late 2003 was reconstructed and now has a timestamp of November 12, 2003.

Unlike Windows, though, OSX makes it easy to modify the create and modified dates for files. From that link, the basic command is:
touch -t YYYYMMDDHHMM filename
I found it more convenient to wrap that in the find command (recursively locating all folders and files) as follows:
find foldername -exec touch -t YYYYMMDDHHMM {} \;

Sometimes it's really nice to be using Unix on the desktop!

No comments:

Post a Comment