linuxmacosterminalunrar

Unrar all file in directory without prompting


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.


Solution

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

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

    From unrar usage:

    o[+|-]        Set the overwrite mode