two chained scripts.

one for loop. one for rename.

renames all files in all subdirectories from

*_kompakt.jpg to *.jpg

overwriting existing (larger) files.

filename: loop.sh 
find . -type d | while read line; do
    /path/to/rename.sh $line;
done
filename: rename.sh
cd $1;
echo " =============== now processing directory"; pwd;
for file in *_kompakt.jpg
do
  mv -fv "$file" "${file/_kompakt.jpg/.jpg}"
done
admin