Skip to content

Instantly share code, notes, and snippets.

@jordelver
Last active March 6, 2018 21:46
Show Gist options
  • Save jordelver/5304643 to your computer and use it in GitHub Desktop.
Save jordelver/5304643 to your computer and use it in GitHub Desktop.
zsh file renaming using zmv

zsh file renaming using zmv

Load the zmv function, best place is in ~/.zshrc

autoload zmv

Rename files using regex captures

Take filenames likes image0001.jpg and rename to 0001.jpg

zmv 'image(*.jpg)' '$1'

Lowercase filenames

zmv '(*)' '${(L)1}'

Source

http://onethingwell.org/post/24608988305/zmv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment