-so (write data to stdout) switch

Causes 7-Zip to write output data to stdout (standard output stream).




7z x archive.gz -so > Doc.txt

decompresses archive.gz archive to output stream and then redirects that stream to Doc.txt file.

7z a dummy -tgzip -so Doc.txt > archive.gz

compresses the Doc.txt file to the 7-Zip standard output stream and writes that stream to archive.gz file.

Commands that can be used with this switch

a (Add), e (Extract), u (Update), x (Extract with full paths)