Unrar all file in directory without prompting
Asked Answered
B

2

16

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.

Baritone answered 29/3, 2014 at 11:54 Comment(0)
N
33

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

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

From unrar usage:

o[+|-]        Set the overwrite mode
Naidanaiditch answered 29/3, 2014 at 11:59 Comment(0)
C
2

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

Cimabue answered 26/12, 2020 at 18:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.