Pergunta

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.

Foi útil?

Solução

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

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

From unrar usage:

o[+|-]        Set the overwrite mode

Outras dicas

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 {} \;

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top