Windows
Linux
File Management
Archives & Compression
Windows 7z a equivalent in Linux
Creates 7z, ZIP and other supported archive formats with the 7-Zip command-line tool.
Windows
→
7z a
Linux equivalents
7z a archive.7z folder/
7z a archive.7z folder/
7z a archive.7z folder/
Overview
What this command does
Creates 7z, ZIP and other supported archive formats with the 7-Zip command-line tool.
Migration tip: The Linux package may be named
7zip, p7zip or p7zip-full, depending on the distribution.Practical tasks
Common use cases
Create a 7-Zip archive
Creates 7z, ZIP and other supported archive formats with the 7-Zip command-line tool.
7z a archive.7z folder/
Create a 7z archive
7z a archive.zip folder/
Create a ZIP archive
7z a -mx=9 archive.7z folder/
Use maximum compression
Ready to run
Copyable Linux commands
Review paths, device names, package names and permissions before running any command.
7z a archive.7z folder/
7z a archive.zip folder/
7z a -mx=9 archive.7z folder/
Walkthrough
Examples with explanations
7z a archive.7z folder/ # create a 7z archive
7z a archive.zip folder/ # create a ZIP archive
7z a -mx=9 archive.7z folder/ # use maximum compression
Reference
Common options and variations
| Command or option | Use |
|---|---|
7z a archive.7z folder/ | Create a 7z archive |
7z a archive.zip folder/ | Create a ZIP archive |
7z a -mx=9 archive.7z folder/ | Use maximum compression |
Distro differences
Debian/Ubuntu vs Fedora vs Arch
This command is the same on Debian/Ubuntu, Fedora and Arch Linux when the relevant tool is installed.
| Distribution | Package manager / base | Equivalent command | Difference to notice |
|---|---|---|---|
| Debian/Ubuntu | same command | 7z a archive.7z folder/ |
Same command on this distribution. |
| Fedora | same command | 7z a archive.7z folder/ |
Same command on this distribution. |
| Arch | same command | 7z a archive.7z folder/ |
Same command on this distribution. |
Keep learning