I have a bunch of video-files in one folder , that has a double suffix avi.avi.  find /home/alex/Filme/  -type f -name '*.avi.avi' /home/alex/Filme/Super 8.avi.avi/home/alex/Filme/Exit - A Night From Hell.avi.avi/home/alex/Filme/Der Plan.avi.avi/home/alex/Filme/Ich.bin.Nummer.4.2011.avi.avisnippI try to remove the double string with following Script #!/bin/bash    for i in `find $HOME/Filme -type f -name '*avi.avi' -print0`     do         sed -e 's/'*.avi.avi'/'*.avi'/g' doneOr is a better way to achive this with rename, like this?find $HOME/Filme -type f -name '*avi.avi' -print0 -exec  sh -c rename -v 's/*.avi.avi/*.avi/g' {} \;I'am not sure if the foldername will be preserved.Yes I found several questions and answers for this, but I have problems to adapt it to my case.example for QuestionDoes one of my approach work? 
moving string from filenames with sed or rename them with rename
sed;rename
You were almost there.find $HOME/Filme -type f -name '*avi.avi' -exec \  sh -c rename -v 's/\.avi\.avi$/.avi/' {} \;(The argument to rename is a regular expression substitution; and the /g option would only be useful if you wanted to substitute every occurrence in a matching file name; but by definition, there can only be one match at the very end.)Perhaps more usefully you can batch this, and maybe just use mv for improved portability.find $HOME/Filme -type f -name '*avi.avi' -exec \  sh -c 'for f; do mv -v $f ${f%.avi}; done' _ {} +If there is no need to traverse subdirectories,for f in $HOME/Filme/*.avi.avi; do    mv -v $f ${f%.avi}done