Skip to content

Instantly share code, notes, and snippets.

@glynhudson
Created July 25, 2018 15:48
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 glynhudson/e7c02cd94352245857cc624908a199b5 to your computer and use it in GitHub Desktop.
Save glynhudson/e7c02cd94352245857cc624908a199b5 to your computer and use it in GitHub Desktop.
Rename extension of all files in a folder
# rename all files with extension passed as argument 1 to m4v
# e.g to rename MOV extension to m4v ./rename-m4v.sh MOV
for file in *.$1
do
mv "$file" "${file%.$1}.m4v"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment