I want to rename many files like
Tum Hi Ho [www.DJMaza.Com].mp3
to Tum Hi Ho.mp3
To do so, I used this command. But somehow it is not working.
`rename -n 's/(.*)([.*])(\.mp3)/$1$3/' *.mp3`
I want to rename many files like
To do so, I used this command. But somehow it is not working.
|
|||
migrated from serverfault.com Oct 1 '16 at 6:42This question came from our site for system and network administrators. |
|||
|
You were close, but not quite:
The problem is that The unescaped brackets form what is called a character class. A character class can basically match any of the characters inside the brackets. So In my regex, we are matching an opening bracket |
||||
|