Skip to content

Instantly share code, notes, and snippets.

@jamesalbert
Last active June 4, 2017 05:02
Show Gist options
  • Save jamesalbert/c3fd6b4892c858e22d184522b0a0086b to your computer and use it in GitHub Desktop.
Save jamesalbert/c3fd6b4892c858e22d184522b0a0086b to your computer and use it in GitHub Desktop.
change the extension of multiple files
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