If you need to rename several files at the same time, in this tutorial I will show you a couple of ways to do it.

Bulk Rename (GUI)

There are several “batch rename” software in Linux (like KRename), but Thunar’s Bulk Rename is the default software for this file manager used in XFCE. You can add the files with the “+” button and select the type od rename you want to perform: modify audio tags, insert date/time in the filename, insert or overwrite characters, numbering, remove characters, replace, and change to uppercase or lowercase.

Bulk Rename window

Rename (Terminal)

rename from util-linux package allows basic batch renaming.

rename [options] <expression> <replacement> <files>
rename 'DSC' 'ABC' *.txt

A more complex example:

$ ls
# trimmed output
ABC_100.txt  ABC_111.txt  ABC_122.txt  ABC_133.txt  ABC_144.txt
ABC_54.txt  ABC_65.txt  ABC_76.txt  ABC_87.txt  ABC_98.txt
$ rename 'ABC_' 'ABC_0' ABC_??.txt
  • This will add a zero after “_” only if there are two digits.
$ ls
# trimmed output
ABC_050.txt  ABC_061.txt  ABC_072.txt  ABC_083.txt  ABC_094.txt
ABC_105.txt  ABC_116.txt  ABC_127.txt  ABC_138.txt  ABC_149.txt