Last active
June 4, 2017 05:02
-
-
Save jamesalbert/c3fd6b4892c858e22d184522b0a0086b to your computer and use it in GitHub Desktop.
change the extension of multiple files
This file contains 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
function chext { | |
for f in *.$1; do | |
mv -- "$f" "${f%.$1}.$2"; | |
done; | |
} | |
# example changing all files *.jpeg to *.jpg: chext jpeg jpg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment