Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
7zr? Shouldn't that be 7za? Or am I being blond? –  user3463 Aug 18 '12 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 '12 at 15:25
add comment

1 Answer

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.
share|improve this answer
    
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 –  PeanutsMonkey Aug 23 '12 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 '12 at 3:09
add comment

Your Answer

 
discard

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.