Skip to content

Instantly share code, notes, and snippets.

@chasevida
Created October 28, 2013 21:25
Show Gist options
  • Save chasevida/7205079 to your computer and use it in GitHub Desktop.
Save chasevida/7205079 to your computer and use it in GitHub Desktop.
Recursively rename files based on extensions. In this particular case, rename files with the '.png' extension to '@2x.png' for retina files not already labelled as such within a given directory.
find . -type f -name '*.'png -print | while read file; do echo "renaming $file to $(basename $file .png)@2x.png"; mv "$file" "$(dirname $file)/$(basename $file .png)@2x.png"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment