2

I accidentally typed

7z e archive.7z

and all the files ended up in my home directory when I wanted to extract them in a subfolder. How can I clean the mess and remove all those files?

Anthon
  • 78,313
  • 42
  • 165
  • 222
assylias
  • 728
  • 1
  • 8
  • 18

1 Answers1

0

Looking at this answer and that one in particular, I ended up running this command which removed all the unwanted files:

7z l archive.zip | awk ' {print $6} ' | awk '
  function basename(file) {
    sub(".*/", "", file)
    return file
  }
  {print basename($1)} ' | xargs rm -rf
assylias
  • 728
  • 1
  • 8
  • 18