How to bulk-rename files with invalid encoding or bulk-replace invalid encoded characters?

Posted by qdoe on Super User See other posts from Super User or by qdoe
Published on 2013-01-18T10:49:24Z Indexed on 2013/11/11 21:58 UTC
Read the original article Hit count: 235

Filed under:
|
|
|

I have a debian server and I'm hosting music for an internet radio station. I have trouble with file names and paths because a lot of files got an invalid encoding, for example:

./music/Bändname - Some Title - additional Info/B?ndname - 07 - This Title Is Cörtain, The EncÃ?ding Not.mp3

Ideally, I would like to remove everything that is not letters A-Z/a-z or numbers 0-9 or dash -/underscore _... The result should look like something like that:

./music/Bndname-SomeTitle-additionalInfo/Bndname-07-ThisTitleIsCrtain,TheEnc?dingNot.mp3

How to achieve this for a batch of a lot of files and directories?

I've seen this similar question: bulk rename (or correctly display) files with special characters

But this only fixes the encoding, I would prefer a more strict approach as described above.

© Super User or respective owner

Related posts about linux

Related posts about batch