Skip to content

Instantly share code, notes, and snippets.

@psema4
Created November 2, 2019 23:02
Show Gist options
  • Save psema4/2d7f273438a346cb47afdadb8eff9f3b to your computer and use it in GitHub Desktop.
Save psema4/2d7f273438a346cb47afdadb8eff9f3b to your computer and use it in GitHub Desktop.
search and replace in filenames
# Search and replace filenames in the current directory
#
# Example:
# tile-000.png
# tile-001.png
# tile-002.png
#
# becomes
# sprite-000.png
# sprite-001.png
# sprite-002.png
#
ls *.png | while read fn; do
mv "${fn}" "${fn/tile-/sprite-}";
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment