2016-02-22 21:50:05 +00:00
|
|
|
# 7z
|
|
|
|
|
|
|
|
> A file archiver with high compression ratio.
|
2019-01-30 11:19:23 +00:00
|
|
|
> Homepage: <https://www.7-zip.org/>.
|
2016-02-22 21:50:05 +00:00
|
|
|
|
2019-02-08 00:31:19 +00:00
|
|
|
- Archive a file or directory:
|
2016-02-22 21:50:05 +00:00
|
|
|
|
2019-02-08 00:31:19 +00:00
|
|
|
`7z a {{archived.7z}} {{path/to/file_or_directory}}`
|
2016-02-22 21:50:05 +00:00
|
|
|
|
2018-02-06 18:25:26 +00:00
|
|
|
- Encrypt an existing archive (including headers):
|
|
|
|
|
2019-04-15 13:09:26 +01:00
|
|
|
`7z a {{encrypted.7z}} -p {{password}} -mhe {{archived.7z}}`
|
2018-02-06 18:25:26 +00:00
|
|
|
|
2016-02-23 00:51:52 +00:00
|
|
|
- Extract an existing 7z file with original directory structure:
|
2016-02-22 21:50:05 +00:00
|
|
|
|
2018-02-06 18:25:26 +00:00
|
|
|
`7z x {{archived.7z}}`
|
2016-02-22 21:50:05 +00:00
|
|
|
|
2018-01-18 03:41:05 +00:00
|
|
|
- Extract an archive with user-defined output path:
|
|
|
|
|
2018-02-06 18:25:26 +00:00
|
|
|
`7z x {{archived.7z}} -o{{path/to/output}}`
|
2018-01-18 03:41:05 +00:00
|
|
|
|
2016-02-23 00:51:52 +00:00
|
|
|
- Archive using a specific archive type:
|
2016-02-22 21:50:05 +00:00
|
|
|
|
2019-02-08 00:31:19 +00:00
|
|
|
`7z a -t {{zip|gzip|bzip2|tar}} {{archived.7z}} {{path/to/file_or_directory}}`
|
2016-02-23 01:00:13 +00:00
|
|
|
|
|
|
|
- List available archive types:
|
|
|
|
|
|
|
|
`7z i`
|
2016-02-22 21:50:05 +00:00
|
|
|
|
2016-02-23 00:51:52 +00:00
|
|
|
- List the contents of an archive file:
|
2016-02-22 21:50:05 +00:00
|
|
|
|
2018-02-06 18:25:26 +00:00
|
|
|
`7z l {{archived.7z}}`
|