For example, if you want to add a '.old' to every file in your current directory. This will do it:
rename 's/$/.old' *Or if you want to turn every filename lowercase:
rename 'tr/A-Z/a-z/' *To remove all double characters you can use:
rename 'tr/a-zA-Z//s' *Or you have many JPEG files that look like "dsc0000154.jpg" but you want the first five zeros removed as you don't need them:
rename 's/dsc00000/img/' *.jpgYou can use any Perl operator as an argument, read the documentation here:
http://perldoc.perl.org/perlop.html#Regexp-Quote-Like-Operators
No comments:
Post a Comment