Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have 7z 4.65 and am trying to extract a single file to standard output. The 7z command-line help says -so is the command-line parameter to extract to standard output, but when I try this:

>>> 7z e -so dist\dlogpkg.jar META-INF/MANIFEST.MF

7-Zip 4.65  Copyright (c) 1999-2009 Igor Pavlov  2009-02-03
I won't write data and program's messages to same terminal

how can I fix this? There doesn't seem to be a command line param to suppress the normal 7z stdout messages.

(edit: the equivalent operation in "unzip" would be

unzip -p dist\dlogpkg.jar META-INF/MANIFEST.MF

which works fine. But I'd like to use 7z for various reasons.)

share|improve this question
up vote 7 down vote accepted

pipe it to another program such as

  • tee
  • less
  • more

i think tee comes closest to what you want, it drops the 7z stuff and just gives you the content.

% 7z e -so dist\dlogpkg.jar META-INF/MANIFEST.MF | tee
share|improve this answer
Is there any reason in particular why you think tee is better in this situation than less? – Andy Jun 3 '10 at 17:51
Odd. "less" and "tee" do what I expect, but "more" leaves in the 7z stuff.... bizarre! why does it do this? – Jason S Jun 3 '10 at 18:01
@Andy: "tee" does even less than "less" .. no scrolling back etc. it just lets the bytes through and not a thing more. – akira Jun 3 '10 at 20:51
@akira maybe he wanted to pipe the output to another program – beppe9000 Sep 30 '15 at 11:48
@Andy: why OP wanted to pipe to stdout was never a question. – akira Sep 30 '15 at 13:22

I was also trying to figure this out. This got me what I wanted:

7z x -so 2> /dev/null
share|improve this answer
Windows equivalent 7z x -so 2> NUL doesn't work: somehow also redirects data to null. – ansgri Dec 26 '12 at 11:15

On Windows, 7z x -so 2> NUL doesn't work, but redirection to a real file helps:

7z x -so 2> _garbage.txt
share|improve this answer

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.