1

I have a 7zip archive that I need to extract to another directory as opposed to the directory that the archive is located in however I get the error "Error:Incorrect command line". The command I am running is 7zr e -o extract/ {name_of_archive}.7z. What am I doing wrong?

2
  • 7zr? Shouldn't that be 7za? Or am I being blond?
    – user3463
    Aug 18, 2012 at 8:15
  • On my system (LMDE), installing p7zip gives 7z, 7za and 7zr. According to their man pages, "7z uses plugins to handle archives.", "7za is a stand-alone executable. 7za handles less archive formats than 7z." and "7zr is a stand-alone executable. 7zr handles less archive formats than 7z. 7zr is a "light-version" of 7za that only handles 7z archives."
    – terdon
    Aug 18, 2012 at 15:25

1 Answer 1

8

Try this command instead (you can use 7z,7za or 7zr):

7z x -oextract/ foo.7z

According to the 7z manpage, there should be no space between the '-o' switch and the directory name:

  -o{Directory}
          Set Output directory



7z, 7za and 7zr :

7-Zip  is  a file archiver with the highest compression ratio. The pro‐
       gram supports 7z (that implements LZMA compression  algorithm),  LZMA2,
       XZ,  ZIP,  Zip64,  CAB,  RAR  (if  the  non-free  p7zip-rar  package is
       installed), ARJ, GZIP, BZIP2, TAR,  CPIO,  RPM,  ISO,  most  filesystem
       images  and  DEB  formats.  Compression  ratio  in the new 7z format is
       30-50% better than ratio in ZIP format.
  • 7z uses plugins to handle archives.
  • 7za is a stand-alone executable. 7za handles less archive formats than 7z.
  • 7zr is a stand-alone executable. 7zr handles less archive formats than 7z.
    7zr is a "light-version" of 7za that only handles 7z archives.
2
  • I don't have the command 7z however have 7zr. Does this mean I have to download a specific package and if so what? I am using Linux Ubuntu 12.04LTS Aug 23, 2012 at 20:05
  • @PeanutsMonkey Look at my comment to your question. You can use 7zr, I've updated my answer to that effect.
    – terdon
    Aug 24, 2012 at 3:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .