

You can use rename utility to convert filenames in lower case or in UPPER CASE using the command in this following way: rename 'y/A-Z/a-z/' BLOG\*.\* Converting UPPER CASE in lower case and the opposite Finding Bulk renaming using regexp, and many other regexp utility help locations through out the web.

In this way you trim the string “Film – “ in all files that start with “Film – “*. If you run the same command without the “-n” option the result will be the following: Image01.png renamed as Italy - 01.pngĮxample 3: rename -v 's/Film - //' Film\ -\ *. In this way you replace the string “Image” with “Italy – “* in every files that start with “Image”ĪTTENTION: the “-n” option simulates the action, it’s a dry-run. g = global, run the replacement for any occurency (if you don’t use “g”, only the first occurency will be replaced).Įxample 2: rename -nv 's/Image/Italy - /' Image*.The meaning of every part of the regular expression s/.sh/.sh.bak/g is the following: In this way you rename the file extension of any files contain the string. To understand better, look at the following examples of bulk rename.Įxample 1: rename -v 's/.sh/.sh.bak/g' *.sh filenames: indicates which files to process.perlexpr: regular expression to indicate the string to substitute and with which string.f: force, force overwrite existing files.I recommend using it before you run it without “n” option. n: no act (dry-run), simulates the result of the command.v: verbose, prints everything it does in terminal.The syntax of rename is very simple: rename perlexpr You can use it like a command (but it isn’t a command). It’s simply named rename and is a Perl program. Many Linux distributions have a bulk rename utility to rename many files at once.
