Skip to content

Instantly share code, notes, and snippets.

@Phlow
Last active September 30, 2015 12:08
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 Phlow/fd983d09e305bda1533b to your computer and use it in GitHub Desktop.
Save Phlow/fd983d09e305bda1533b to your computer and use it in GitHub Desktop.
Rename files and replace text with new text
# Rename file and replace OLDTEXT with NEWTEXT
# for filename in *.jpg; do mv "$filename" "${filename//OLDTEXT/NEWTEXT}"; done
# replace large with nothing
for filename in *.jpg; do mv "$filename" "${filename//large/}"; done
for filename in *.xml; do mv "$filename" "${filename//_meta.xml/.md}"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment