rename
utility allows bulk rename of files and/or directories. You can install this utility using $ sudo apt install rename
command. Let's say that we want to replace " - lang_en" string from all files in the current directory with, "".
rename s/"**TO-BE-REPLACED**"/"**REPLACEMENT**"/g *
Now, in our case, we want to run this command in a test or simulation mode before, really renaming the files. We can do so by supplying -n
switch.
Simulation / test mode:
$ rename -n s/" - lang_en"/""/g ./*.srt
$ rename s/" - lang_en"/""/g ./*.srt