zmv 

Send to Kindle
home » snippets » zsh » zmv



Snippets

# For example, rename all the avi files to replace _ by
# simple spaces, replace '.' by simple spaces lowercase
# the filename, and capitalise the first letter of each
# words :

zmv '(*).avi' '${${(LC)1//./ }//_/ }.avi'


# If you want case insensitivity pattern matching you
# can add (#i) at the begining of the first sentence for
# exemple
#
# All files having for extenstions .avi or .Avi or .AVI
# or etc. will match and will be renamed as previously.

zmv '(#i)(*).avi' '${${(LC)1//./ }//_/ }.avi'