I have a lot of files that contain a few things in their name that i want to remove. For example I have 78 Files with the name first(official).mp3, 2nd(official)Tutorial.mp3 ...... and so on till 78 with all different names but (official) somewhere in the middle of the name and sometimes at the last and sometimes at the start. I read one answer which tells you how to rename all the files if something like this (official) is at the start. You can check it at this link Rename multiple files in terminal . but i cant find how to rename multiple files if the same thing is in the middle or end of the name. How to do it?
Asked
Active
Viewed 31 times
rename -n 's/\(official\)//'
will remove the first occurence andrename -n 's/\(official\)//g'
will remove every occurence of the string “(official)”. – dessert Sep 08 '18 at 07:11