Saturday, January 23, 2016

Batch rename files (Useful for renaming track numbers from a mp3 file)



I have around 600 mp3 song files in a folder. All the tracks have a number before their names.
How to remove the track-number from all the files.

The easiest way to do this is with rename on the command-line. For example: For example to remove a prefix abcd from abcd1.txt, abcd2.txt, abcd3.txt etc. 

In order to get 1.txt, 2.txt, 3.txt simply use

rename "abcd*.txt" "////*.txt"

You need the same number of / as the number of initial characters you would like to remove. Do place double quotes for both arguments.