06-17-2018, 01:19 PM
First what I'd do is right click in the directory, open a terminal from it. Then just paste this command and you will see all rar files be expanded to the current directory.
will only be run to remove the .rar file if the unrar-ing succeeds
(-exec unrar e {} \;)
i.e. unrar returns with exit status 0.
You can also do this using bash, using globstar option to recursively match glob pattern (*.rar), and rm each file if unrar-ing is successful:
Now I'm using Ubuntu 16.04 ltz as a home server. Use this command a lot with torrenting ;)
Code:
find . -name '*.rar' -exec unrar e {} \; -exec rm {} \;
Code:
-exec rm {} \;
will only be run to remove the .rar file if the unrar-ing succeeds
(-exec unrar e {} \;)
i.e. unrar returns with exit status 0.
You can also do this using bash, using globstar option to recursively match glob pattern (*.rar), and rm each file if unrar-ing is successful:
Code:
shopt -s globstar
for f in **/*.rar; do
unrar e "$f" && rm "$f"
done
Now I'm using Ubuntu 16.04 ltz as a home server. Use this command a lot with torrenting ;)