commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
The command renames all files in a certain directory. Renaming them to their date of creation using EXIF. If you're working with JPG that contains EXIF data (ie. from digital camera), then you can use following to get the creation date instead of stat.
* Since not every file has exif data, we want to check that dst is valid before doing the rest of commands.
* The output from exif has a space, which is a PITA for filenames. Use sed to replace with '-'.
* Note that I use 'echo' before the mv to test out my scripts. When you're confident that it's doing the right thing, then you can remove the 'echo'... you don't want to end up like the guy that got all the files blown away.
There are 10 alternatives - vote for the best!
If you can do better, submit your command here.
You must be signed in to comment.