Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have about 1000 rar files, that randomly contains an EXE file named:"JPG-Crack.exe". I need to delete it from all archives without harming the other archive content.


share|improve this question

1 Answer 1

To delete files in a rar archive we may use the option d. This can easily be integrated in a recursive action like e.g.:

for f in *.rar; do rar d "$f" JPG-Crack.exe; done

The above command will find and delete JPG-Crack.exe files in all *.rar archives of the current directory.

share|improve this answer
double quoting $f would not hurt... –  gniourf_gniourf Jan 1 '13 at 20:36
@gniourf_gniourf: thanks - done :) –  Takkat Jan 1 '13 at 20:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.