anomalous territory

Linux/OSX mass file renaming

by volve on Jan.22, 2008, under linux

A handy command-line of text to mass rename files (in this case, change file extensions) that works in Linux and OSX:

ls -d *.cbz | sed 's/\(.*\).cbz$/mv -v "&" "\1.cbr"/' | sh

In this example, all .cbz files are renamed to .cbr (as I noticed some comic book archives I had were wrong).

An even more concise version using ‘basename’ was mentiond but OSX seems to have different default extension handling.

[via http://6v8.gamboni.org/Mass-renaming-with-linux-shell.html]


Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!