Quick Start Guide
This guide will get you up and running with 7-Zip quickly. You’ll learn the most common operations: creating archives, extracting files, listing contents, and testing archive integrity.On Linux/macOS, use
7zz as the command. On Windows, use 7z (or 7z.exe with full path). The examples below use 7z for simplicity, but both work identically.Basic Command Structure
7-Zip commands follow this pattern:- command - Single letter command (a, x, e, l, t, etc.)
- switches - Optional parameters starting with
- - archive_name - Name of the archive file
- file_names - Files or directories to process
Creating Your First Archive
Create a simple archive
Compress a single file or directory into a 7z archive:The
a command means add to archive. If the archive doesn’t exist, 7-Zip creates it.Set compression level
Control the compression ratio vs. speed tradeoff:Compression levels:
-mx0- Store only (no compression)-mx1- Fastest compression-mx3- Fast compression-mx5- Normal (default)-mx7- Maximum-mx9- Ultra (slowest, best compression)
Create a password-protected archive
Add encryption to protect sensitive data:7-Zip will prompt you to enter a password. To specify the password inline:
Create archives in other formats
Use the Supported archive types for creation:
-t switch to specify the archive format:7z- 7-Zip native format (default, best compression)zip- ZIP archivegzip- GZIP compressedbzip2- BZIP2 compressedtar- TAR archive (no compression)wim- Windows Imaging Formatxz- XZ compressed
Extracting Archives
Extract with full paths
Use the
x command to extract files with their directory structure:Note: There is no space between
-o and the path. The correct syntax is -o/path/ not -o /path/.Extract without paths
Use The
e to extract all files to a single directory (no subdirectories):e command extracts all files to the same folder, ignoring the original directory structure.Listing Archive Contents
Before extracting, you can view what’s inside an archive:List files in archive
Use the Output shows:
l (list) command:- Date and time
- File attributes
- File size
- Compressed size
- File name
Testing Archives
Verify archive integrity without extracting:t command checks:
- CRC checksums
- Archive structure
- Compression integrity
- File data validity
Common Use Cases
Backup a Directory
Split Large Archives into Volumes
large_archive.7z.001large_archive.7z.002large_archive.7z.003- etc.
Update Existing Archive
Delete Files from Archive
Hash Calculation
Benchmark System Performance
Test your CPU’s compression and decompression speed:Useful Switches Reference
Here are the most commonly used switches:| Switch | Description | Example |
|---|---|---|
-o<path> | Set output directory | 7z x file.7z -o/tmp/ |
-p<pwd> | Set password | 7z a -pSecret file.7z data.txt |
-mx<level> | Set compression level (0-9) | 7z a -mx9 file.7z data/ |
-mmt<N> | Set number of CPU threads | 7z a -mmt4 file.7z data/ |
-r | Recurse subdirectories | 7z a file.7z *.txt -r |
-t<type> | Set archive type | 7z a -tzip file.zip data/ |
-v<size> | Create volumes | 7z a -v100m file.7z data/ |
-y | Assume Yes on all queries | 7z x file.7z -y |
-bd | Disable progress indicator | 7z a file.7z data/ -bd |
-sdel | Delete files after archiving | 7z a file.7z *.log -sdel |
-ao<mode> | Overwrite mode (a/s/t/u) | 7z x file.7z -aoa |
-slt | Show technical info | 7z l -slt file.7z |
-bb<level> | Set output log level (0-3) | 7z a file.7z data/ -bb3 |
Command Quick Reference
| Command | Description | Example |
|---|---|---|
a | Add files to archive | 7z a archive.7z files/ |
x | Extract with full paths | 7z x archive.7z |
e | Extract without paths | 7z e archive.7z |
l | List contents | 7z l archive.7z |
t | Test archive integrity | 7z t archive.7z |
u | Update archive | 7z u archive.7z newfile.txt |
d | Delete from archive | 7z d archive.7z oldfile.txt |
h | Calculate hash | 7z h -scrcSHA256 file.iso |
b | Benchmark | 7z b |
i | Show codec info | 7z i |
rn | Rename files in archive | 7z rn archive.7z old.txt new.txt |
Best Practices
Next Steps
Command Reference
Explore all available commands and switches in detail
Advanced Usage
Learn advanced techniques like SFX archives, filtering, and automation
Format Specifications
Understand the 7z format and other supported archive types
Compression Methods
Deep dive into LZMA, LZMA2, PPMd, and other compression algorithms