Linux/OSX mass file renaming

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]

0 Responses to “Linux/OSX mass file renaming”


  1. No Comments

Leave a Reply

Powered by WP Hashcash