Last Updated: February 25, 2016
·
564
· mkaito

Clean up file names with zmv

I read a lot of manga. Unfortunately, my local stores don't carry any, so I'm forced to rely on "scanlations", or scanned translations. Some groups have this down to an art, but they can't ever seem to agree on a file naming convention. I like my things neat and tidy, so I use zmv to clean the file names up a little:

zmv '*_ch([[:digit:]]##)*_*.(*)' 'Some_Manga_ch$1.$2'

You'll have to adjust the pattern, depending on what you have, but this works surprisingly well. We're capturing the chapter number (note the ## non-greedy quantifier), and the extension. God forbid these people could at least agree on an archive format.