Question

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.

Was it helpful?

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

OTHER TIPS

Do not list *.rar files in other directories (only where the command is run) using maxdepth. Remove print or messages on the screen with -inul.

find . -maxdepth 1 -type f -name "*.rar" -exec unrar x -o+ -inul {} \;

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top