one go:

example: find all xmlrpc.php and rename it to xmlrpc.php.disabled

find . -type f -name 'xmlrpc*' -exec sh -c 'x="{}"; mv "$x" "${x}.disabled"' \;

two chained scripts:

one for loop. one for rename.

renames all files in all subdirectories from

*_stuff.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 *_stuff.jpg
do
mv -fv "$file" "${file/_stuff.jpg/.jpg}"
done

liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!
admin