Unrar all file in directory without prompting

Rory Zipher picture Rory Zipher · Mar 29, 2014 · Viewed 20.6k times · Source

I tried:

find . -name "*.rar" -exec unrar x -o {} \;

Output:

Extracting from ./setup.part2.rar

Extracting from ./setup.part1.rar

RORY/nsfw.zip already exists. Overwrite it ? [Y]es, [N]o, [A]ll, n[E]ver, [R]ename, [Q]uit A

I can't have this prompting me; both hands occupied unfortunately. thought the -o flag would do it, but nope.

Answer

devnull picture devnull · Mar 29, 2014

You need to specify -o+ to enable automatic overwriting:

find . -name "*.rar" -exec unrar x -o+ {} \;

From unrar usage:

o[+|-]        Set the overwrite mode