Mar 052013
 

I often use the “-” symbol to separate parts of a long filename.  For example, my photos are systematically named things like “20130214-1123-34_some_event.jpg”.  For filename maintenance I regularly use the rename command, which allows me to do things like

rename some another *

which would replace the word “some” with the word “another” for every filename in the current directory.  When I need to replace a chunk of filename starting with the “-” character, the rename command thinks I’m passing it an option.  I’ve just found a helpful answer that shows how the “end-of-options” signal fixes this problem.  This signal is simply a double dash “–“.  For example, this command

rename — -11 -10 *

would change the timezone on a bunch of photo filenames.

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)