0

Possible Duplicate:
How to de-unzip, de-tar -xvf — de-unarchive in a messy folder?

I just extracted a RAR archive that contained a lot of files in the base directory. Assuming that there were no filename collisions, what's the easiest way to remove the files just created? Parsing unrar -l seems troublesome due to filename variety.

1 Answers1

1

Use unrar lb archive.rar to get a list of bare filenames, one per line. As long as none of the filenames contained newlines, this should be trivial to parse:

unrar lb archive.rar | perl -ne 'chomp; -d ? rmdir : unlink'
cjm
  • 27,160