Skip to content

Instantly share code, notes, and snippets.

@MatthewRDodds
Last active August 29, 2015 14:25
Show Gist options
  • Save MatthewRDodds/18362df68b09f23aff6f to your computer and use it in GitHub Desktop.
Save MatthewRDodds/18362df68b09f23aff6f to your computer and use it in GitHub Desktop.
Batch rename files in folder
# Should rename test_controller.coffee to test.coffee
for old in ./*_controller.coffee; do
new=$(echo $old | sed -e 's/_controller//')
echo "moving $old to $new"
mv -v "$old" "$new"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment