HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

7za — File archiver with a high compression ratio. Similar to `7z` except that it supports fewer file type

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandcompressionclifile7zawithhigharchiver

Problem

How to use the 7za command: File archiver with a high compression ratio. Similar to 7z except that it supports fewer file types but is cross-platform. More information: <https://manned.org/7za>.

Solution

7za — File archiver with a high compression ratio. Similar to 7z except that it supports fewer file types but is cross-platform. More information: <https://manned.org/7za>.

[a]rchive a file or directory:
7za a {{path/to/archive.7z}} {{path/to/file_or_directory}}


Encrypt an existing archive (including file names):
7za a {{path/to/encrypted.7z}} -p{{password}} -mhe={{on}} {{path/to/archive.7z}}


E[x]tract an archive preserving the original directory structure:
7za x {{path/to/archive.7z}}


E[x]tract an archive to a specific directory:
7za x {{path/to/archive.7z}} -o{{path/to/output}}


E[x]tract an archive to stdout:
7za x {{path/to/archive.7z}} -so


[a]rchive using a specific archive type:
7za a -t{{7z|bzip2|gzip|lzip|tar|...}} {{path/to/archive.7z}} {{path/to/file_or_directory}}


[l]ist the contents of an archive:
7za l {{path/to/archive.7z}}


Set the level of compression (higher means more compression, but slower):
7za a {{path/to/archive.7z}} -mx={{0|1|3|5|7|9}} {{path/to/file_or_directory}}

Code Snippets

[a]rchive a file or directory

7za a {{path/to/archive.7z}} {{path/to/file_or_directory}}

Encrypt an existing archive (including file names)

7za a {{path/to/encrypted.7z}} -p{{password}} -mhe={{on}} {{path/to/archive.7z}}

E[x]tract an archive preserving the original directory structure

7za x {{path/to/archive.7z}}

E[x]tract an archive to a specific directory

7za x {{path/to/archive.7z}} -o{{path/to/output}}

E[x]tract an archive to `stdout`

7za x {{path/to/archive.7z}} -so

Context

tldr-pages: common/7za

Revisions (0)

No revisions yet.