Skip to content

Instantly share code, notes, and snippets.

@iholler
Created December 1, 2017 15:30
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 iholler/271ec3ca2e7815fafb6faf03efc91bb1 to your computer and use it in GitHub Desktop.
Save iholler/271ec3ca2e7815fafb6faf03efc91bb1 to your computer and use it in GitHub Desktop.
Bash function to change the extension on all files in current folder.
function chext() {
origExt=$1
newExt=$2
for f in *"${origExt}"; do
mv -- "$f" "${f%.$origExt}.$newExt"
done
return
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment