p7zip
Compress/decompress 7z archives
TLDR
Archive a file, replacing it with a 7zipped compressed version
Archive a file keeping the input file
Decompress a file, replacing it with the original uncompressed version
Decompress a file keeping the input file
Skip some checks and force compression or decompression
SYNOPSIS
7z command [switches...] archive_name [file_names...]
PARAMETERS
a
Add files to archive.
d
Delete files from archive.
e
Extract files from archive to current directory.
l
List contents of archive.
t
Test integrity of archive.
u
Update files in archive.
x
Extract files with full paths.
-ppassword
Specify password for archive.
-oDirectory
Set output directory.
Specify a destination directory for extracted files.
-y
Assume Yes on all queries.
-r
Recurse subdirectories. This is often used to include all files and subdirectories within a specified directory.
-tType
Specify archive type.
Examples: 7z, zip, gzip, bzip2, tar
-mx=Level
Set compression level.
Level can be 0 (Store) to 9 (Ultra).
DESCRIPTION
p7zip is a command-line tool providing 7-Zip functionality on Linux and Unix-like systems. It allows you to create, extract, and manipulate 7z archives as well as supporting other archive formats.
7-Zip's high compression ratio and strong encryption capabilities make p7zip a valuable tool for archiving, backing up, and securely transferring files. It's particularly useful when compatibility with 7-Zip archives is required on a Linux environment. The tool can handle large files and complex directory structures. In addition to the native .7z format, p7zip supports other archive types through plugins, including but not limited to zip, gzip, bzip2, tar, and xz. This enables a single tool to manage a variety of archive formats.
Note that p7zip is based on an older version of 7-Zip, so features and performance may not always match the latest Windows version.
CAVEATS
p7zip is based on an older version of the original 7-Zip codebase. Newer versions of 7-Zip may offer enhanced features and compression capabilities not found in p7zip. Also, note that encryption strength and algorithm support may be limited compared to the newest 7-Zip implementations.
EXIT CODES
p7zip returns different exit codes to show the result of the operations.
0 - No errors
1 - Warning (Non fatal errors). For example, some files are locked during compressing.
2 - Fatal error
7 - Command line error
8 - Not enough memory for operation
255 - User stopped the process
HISTORY
p7zip was created to bring the 7-Zip archiving utility to Linux and other Unix-like operating systems. It provides command-line access to 7-Zip's archive creation, extraction, and manipulation functionalities, enabling users to work with 7z archives within a Linux environment. Development focused on porting the core 7-Zip code to ensure compatibility and functionality on these platforms. Usage has been widespread among Linux users needing 7-Zip support, particularly in scenarios involving data archiving, backup, and secure file transfer.