[Bash] Renamming files


I want to write a little bash script to rename some files like this :

input :
exemple - thing - REMOVETAG.ext
another - file - REMOVETAG.ext
output :
exemple - thing.ext
another - file.ext

So I want to reneme all files without the " - REMOVETAG" (if they have).

I know there is awk, cut, sed but I don’t know hot to use them, so if you could help and teach :slight_smile:


rename ' - REMOVETAG' '' *REMOVETAG*

Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below…

Thanks, I didn’t know that this command was so usefull!