Skip to content

Instantly share code, notes, and snippets.

@ik5
Created October 11, 2012 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ik5/3874020 to your computer and use it in GitHub Desktop.
Save ik5/3874020 to your computer and use it in GitHub Desktop.
recursive rename file using bash, removing last 2 chars of the new name
recursivemv() {
for d in *; do
if [ -d $d ]; then
(cd $d; recursivemv);
else
mv "$d" ${d:0:-2}
fi
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment