I have several .JPG files and I want them to be .jpg files but every suggested rename script uses "mv" and the manual page (on Mountain Lion) for mv says it does a copy and delete which explains why when I run the script the "created/modified/etc" dates are all changed to the current date. I don't want that to happen. What can I do?
So, I want to mess around with these. I even found a good old file, modified in 2006.
Make a new dir for them
Run through them with a loop
Now, they're in newdir and removed from current dir. But we want them back - can't use mv though.
Tadaa
Use
touch -r
to set the timestamp of one file to another.That
touch
says "Set the timestamp ofnewfile
to the timestamp ofoldfile
."Here's a blog post with more about
touch
and how to use it.All of that copy + touch should not be necessary, though. You say that the manual says that "mv says it does a copy and delete" but that's not accurate. I'm thinking you may have misread it. You should be able to use
mv
to rename a file. You may be running into a problem because on HFS+, the Mac filesystem, filenames are case-insensitive, so "foo.jpg" is the same as "FOO.JPG".