community man page

7z

File archiver with a high compression ratio.

8 examples·source: tldr · CC-BY·status: verified
Reading is open to everyone. Suggesting a flag, fixing an example or adding a recipe is opening to verified-email accounts soon — every change is moderated before it goes live.
curl https://curlhub.sh/man/7z
same page, in your terminal

Examples

add a file or directory to a new or existing archive

7z a path/to/archive.7z path/to/file_or_directory

Encrypt an existing archive (including filenames)

7z a path/to/encrypted.7z -ppassword -mhe=on path/to/archive.7z

Extract an archive preserving the original directory structure

7z x path/to/archive.7z

Extract an archive to a specific directory

7z x path/to/archive.7z -opath/to/output

Extract an archive to `stdout`

7z x path/to/archive.7z -so

archive using a specific archive type

7z a -t7z|bzip2|gzip|lzip|tar|zip path/to/archive path/to/file_or_directory

list the contents of an archive

7z l path/to/archive.7z

Set the level of compression (higher means more compression, but slower)

7z a path/to/archive.7z -mx=0|1|3|5|7|9 path/to/file_or_directory