2
I have a bunch of JPEG files with exactly the same name (i.e. "orig.jpg") each in a seperate subdirectory. Each subdirectory has a unique name (e.g. xplmz3nc5n, tyrn5m6ktv, etc...).
I want to rename the jpegs based on their creation date/time (e.g. 20120629_142536.jpg, etc..).
I was able to use photoshop to batch rename each file with a unique identifier. The key feature that allowed this was photoshop's ability to "include all subdirectories" in a batch process. I was hoping to be able then use exiftool to rename the files to include the creation date (for easy cataloging). Unfortunately, the photoshop batch rename process rewrites the creation date of the file to today's date...
Any suggestions on a way to batch rename the files in a series of subdirectories using, say, terminal commands?
EDIT
The answer here and got the following result in Terminal
cd ~/foo
for dir in *; do
t=`stat -c %y "$dir" | awk '{print $1"-"$2}' |
cut -d ":" -f 1,2 | sed 's/://'`
mv "$dir" "$t"_"$dir";
done
and got
stat: illegal option -- c usage: stat [-FlLnqrsx] [-f format] [-t timefmt] [file ...] stat: illegal option -- c usage: stat [-FlLnqrsx] [-f format] [-t timefmt] [file ...] stat: illegal option -- c usage: stat [-FlLnqrsx] [-f format] [-t timefmt] [file ...]
(i.e. I tried two different methods...).
have you tried anything yourself? – suspectus – 2015-01-09T13:30:40.113
"but won't work in Darwin.." Why do you say that? What did you try exactly, and what were the results? – Ƭᴇcʜιᴇ007 – 2015-01-09T14:58:52.537
I'm really at a loose end with this. Please post an answer if you know how this would be done. Thanks. – geordie – 2015-01-09T22:38:26.047
1Graphic Converter (shareware, not free, but might have a free trial) has some GREAT rename options. I use this ALL the time to manage my digital photos. If you're not a programmer, I'd try to get a tool that does this for you. (I am a programmer, and I still use "GC" for this kind of thing!) – jimtut – 2015-01-10T18:59:57.690