Skip to content

Instantly share code, notes, and snippets.

@tdegrunt
Created December 11, 2011 20:37
Show Gist options
  • Save tdegrunt/1462607 to your computer and use it in GitHub Desktop.
Save tdegrunt/1462607 to your computer and use it in GitHub Desktop.
ZSH: zmv example, renames files, uppercase base name, lowercase extension
zmv '(*.mkv)' '${(U)1:r}.${(L)1:e}' # current directory only
zmv '(**/)(*.mkv)' '$1${(U)2:r}.${(L)2:e}' # recursive traversal
@tdegrunt
Copy link
Author

zmv '(??).mkv' 'S01E$1.mkv'
zmv -n '(??)*.avi' 'S01E$1.avi'

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