Last active
December 15, 2017 09:16
-
-
Save berliozd/ab93a58d776ad348764144822b8e6a11 to your computer and use it in GitHub Desktop.
bash one-liner file renaming
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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