7-Zip Manual
An unofficial mirror of the 7-Zip 26.04 documentation, not affiliated with 7-Zip, with tested examples. Download 7-Zip from 7-zip.org. Commands below use 7zz, the official Linux and macOS binary; on Windows type 7z.
Extract archives
- Extract into a specific folder:
7zz x archive.zip -oout - Extract only some files or one folder:
7zz x archive.zip 'folder/sub/*' -oout - Extract a .tar.gz in one step:
7zz x a.tar.gz -so | 7zz x -si -ttar -oout - List files before extracting:
7zz l archive.7z - Keep both files when names clash:
7zz x archive.zip -aou
Create archives
- Create a zip or 7z from a folder:
7zz a archive.zip folder/ - Maximum compression:
7zz a -mx=9 archive.7z folder/ - Create a .tar.gz:
7zz a -ttar -so -an folder | 7zz a -si -tgzip folder.tar.gz - Exclude files or folders:
7zz a backup.7z project/ -xr'!node_modules' - Add only new and changed files:
7zz u backup.7z project/
Protect, split and verify
- Password-protect and hide file names:
7zz a -psecret -mhe=on secret.7z docs/ - Split into parts:
7zz a backup.7z folder/ -v100m; extract frombackup.7z.001 - Test an archive for damage:
7zz t archive.7z - Get or verify a SHA256 checksum:
7zz h -scrcsha256 -slfhn -ba file.iso
Scripts and automation
- Silence output:
7zz a a.7z folder -bso0 -bsp0 - Check exit codes:
7zz t a.7z || echo failed - Stop the overwrite prompt:
7zz x a.zip -y -oout - Print one file to stdout or a pipe:
7zz x a.7z -so folder/a.txt - Quote paths with spaces, read names from a list file
File Manager (GUI)
- Linux or macOS: is there a File Manager? It is Windows only; this page maps its actions to commands.
- Add to Archive dialog
- Extract dialog
Reference
- All commands: x or e, a, l, t
- All switches, by task
- Faster compression and RAM use
- FAQ