Skip to content

Instantly share code, notes, and snippets.

@macterra
Created August 18, 2011 21:36
Show Gist options
  • Save macterra/1155302 to your computer and use it in GitHub Desktop.
Save macterra/1155302 to your computer and use it in GitHub Desktop.
recursively strip the last two chars from filenames
#!/bin/sh
#recursively strip the last two chars from filenames
#shane s antyr
find . -type f -print | while read file
do
file_clean=$( echo ${file} | sed 's/\(.*\)../\1/')
echo $file $file_clean
mv $file $file_clean
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment