rename [ -v ] [ -n ] [ -f ] perl_expression [ files ]
to rename for example multiple photo files with '.JPG' extension to '.jpg' extension:
rename -v ’s/\.JPG$/\.jpg/’ *.JPG
The perl substitution for regular expression syntax is: s/old/new/.
s means 'substitute'. Period character substitutes any character, but in this case it's not wanted and we need to escape it with '\'.
No comments:
Post a Comment