Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

rename or prename is Perl a tool which can rename multiple files using regular expression.
For example to rename ??.mp3 files to 0??.mp3: remove underline mark (_) from file name

No Format
rename -v 's/(\d{2}).mp3/0$1.mp3_//' ??.mp3*
-v, --verbose
-n, --no-act
Note
titleTest before action

Usually you should use -n and -v option to test your expression. After you make sure that it works as you expected, remove the -n option to do the real job.

Another example: to rename ??.mp3 files to 0??.mp3

No Format

rename -v 's/(\d{2}).mp3/0$1.mp3/' ??.mp3