Skip to content

Instantly share code, notes, and snippets.

@berliozd
Last active December 15, 2017 09:16
Show Gist options
  • Save berliozd/ab93a58d776ad348764144822b8e6a11 to your computer and use it in GitHub Desktop.
Save berliozd/ab93a58d776ad348764144822b8e6a11 to your computer and use it in GitHub Desktop.
bash one-liner file renaming
# rename all *.JPG to *.jpg
for f in *.JPG; do mv -i "$f" "${f%%.*}.jpg"; done
# move all files containing _dm in the folder ../dm
for f in *_dm*; do mv -i "$f" "../dm/${f%%}"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment