Batch unrar from OS X terminal

Here’s an easy way to unrar many archives at once into a specified folder.

Requires the command-line version of unrar to be installed. If you already have the excellent app UnRarX installed, you can use the unrar executable that’s included in the app instead if you want. Just replace unrar with /Applications/UnRarX.app/Contents/Resources/unrar.

find /Volumes/Path/To/Rar:ed/Content/ -name ‘*.rar’ -execdir unrar e -o- {} /Volumes/Path/To/Un:rared/Content/ \;

I find this especially useful to extract multiple episodes of a specific TV series for use with Plex, for example:

find /Volumes/Path/To/Rar:ed/Content/Name.of.TV.Series.S01* -name ‘*.rar’ -execdir unrar e -o- {} /Volumes/Path/To/Un:rared/Content/ \;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s