Tuesday, September 11, 2012

Rename files- & directories-name which contains umlaut

I would like to change the file name, which contains umlaut, with normal characters:

For example: ü with ue or Ä with Ae.

Here is my commands:

for i in `find -name '*ü*'`; do mv $i `echo $i | sed 's/ü/ue/'`; done
for i in `find -name '*Ä*'`; do mv $i `echo $i | sed 's/Ä/Ae/'`; done

and the following command for the directories:
for i in `find -type d -name '*Ä*'`; do mv $i `echo $i | sed 's/Ä/Ae/'`; done

No comments: