linuxcli

LINUX CLI

debugrenamescript

Habe Ich von hier: https://forum.ubuntuusers.de/topic/umlaute-in-videodateien-ersetzen/

sudo apt-get install rename
nano rename.sh
chmod +x rename.sh
./rename.sh
#!/bin/bash

#Ordner
find -depth -type d -execdir rename -v 's/Ä/Ae/g;
s/Ö/Oe/g;
s/Ü/ue/g;
s/ä/ae/g;
s/à/a/g;
s/è/e/g;
s/é/e/g;
s/ö/oe/g;
s/ü/ue/g;
s/@/at/g;
s/\"/-/g;
s/\[/-/g;
s/\]/-/g;
s/\302\201/ue/g;
s/\302\204/ae/g;
s/\302\224/oe/g;
s/\201/ue/g;
s/\224/oe/g;
s/\204/ae/g;
s/\232/Ue/g;
s/\207/./g;
s/\200/./g;
s/�/ae/g;
s/�/oe/g;
s/ /_/g;
s/,/_/g;
s/\)/-/g;
s/\(/-/g;
s/\:/-/g;
s/\&/und/g;
s/\+/und/g;
s/\x27/_/g;
' '{}' \;

#Datei
find . -type f -exec rename -v 's/Ä/Ae/g;
s/Ö/Oe/g;
s/Ü/ue/g;
s/ä/ae/g;
s/à/a/g;
s/è/e/g;
s/é/e/g;
s/ö/oe/g;
s/ü/ue/g;
s/@/at/g;
s/\"/-/g;
s/\[/-/g;
s/\]/-/g;
s/\302\201/ue/g;
s/\302\204/ae/g;
s/\302\224/oe/g;
s/\201/ue/g;
s/\224/oe/g;
s/\204/ae/g;
s/\232/Ue/g;
s/\207/./g;
s/\200/./g;
s/�/ae/g;
s/�/oe/g;
s/ /_/g;
s/,/_/g;
s/\)/-/g;
s/\(/-/g;
s/\:/-/g;
s/\&/und/g;
s/\+/und/g;
s/\x27/_/g;
' '{}' \;

anderer Ansatz und neuer von hier: https://forum.ubuntuusers.de/topic/umlaute-dateien-und-ordner-umbenennen/

#!/bin/bash
###########################################################
echo Umlaute aendern 192.168.178.119
echo Datei und Unterordner umbenennen
find /home/pi/Nas/ -depth -exec rename -v 's/Ä/Ae/g;
s/\s/_/g;
s/Ö/Oe/g;
s/Ü/Ue/g;
s/ä/ae/g;
s/à/a/g;
s/è/e/g;
s/é/e/g;
s/ö/oe/g;
s/ü/ue/g;
s/ß/ss/g;
s/@/at/g;
s/\?/-/g;
s/\"/-/g;
s/\[/-/g;
s/\]/-/g;
s/\337/ss/g;
s/\302\201/ue/g;
s/\302\204/ae/g;
s/\302\224/oe/g;
s/\374/ue/g;
s/\201/ue/g;
s/\224/oe/g;
s/\204/ae/g;
s/\344/ae/g;
s/\232/Ue/g;
s/\334/Ue/g;
s/\326/Oe/g;
s/\207/./g;
s/\200/./g;
s/�/ae/g;
s/�/oe/g;
s/ /_/g;
s/,/_/g;
s/_-_/_/g;
s/\)/-/g;
s/\(/-/g;
s/\:/-/g;
s/\&/und/g;
s/\+/und/g;
s/\x27/_/g;
' '{}' \;
  • linuxcli.txt
  • Zuletzt geändert: 2021/08/24 14:16
  • von Fabian Horst