Skip to content

Instantly share code, notes, and snippets.

@glegoux
Last active July 27, 2017 21:56
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 glegoux/13c2f45bc81ce08de152 to your computer and use it in GitHub Desktop.
Save glegoux/13c2f45bc81ce08de152 to your computer and use it in GitHub Desktop.
[Bash] Rename several files
#!/bin/bash
for filename in `ls -1 | grep -E .mp4$\|.wmv$\|.ogv$`; do
ext="${filename##*.}"
name="${filename%.*}"
mv "${name}.${ext}" "${name}_v1.${ext}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment