Mar 31, 2012 - The 'standard' way to work with 7-Zip archives on Unix is to use P7ZIP. Expect P7ZIP to come installed on Linux distributions by default.
p7zip is command line port of 7-Zip for POSIX systems, including Linux.
4Troubleshooting
Installation
Install the p7zip package.
The command to run the program is the following:
Examples
Warning: Do not use 7z format for backup purposes, because it doesn't save owner/group of files. See 7z(1) for more details.
Add file/directory to the archive (or create a new one):
Also it is possible to set password with flag -p and hide structure of the archive with flag -mhe=on:
Update existing files in the archive or add new ones:
List the content of an archive:
Extract all files from an archive to the current directory without using directory names:
Extract with full paths:
Extract into a new directory:
Check integrity of the archive:
Differences between 7z, 7za and 7zr binaries
The package includes three binaries, /usr/bin/7z, /usr/bin/7za, and /usr/bin/7zr. Their manual pages explain the differences:
7z(1) uses plugins to handle archives.
7za(1) is a stand-alone executable that handles fewer archive formats than 7z.
7zr(1) is a stand-alone executable. It is a 'light-version' of 7za that only handles 7z archives. In contrast to 7za, it cannot handle encrypted archives.
Troubleshooting
ZIP archives are extracted with wrong encoding
If you see file/directory names extracted with wrong encoding, install unzip-iconvAUR. Usually it happens with archives created in the Windows File Explorer. Consider using 7-Zip in order to avoid such problems in the future.
See also
Retrieved from 'https://wiki.archlinux.org/index.php?title=P7zip&oldid=574739'
Beta or prerelease software is not intended for inexperienced users, as the software may contain bugs or may potentially damage your system. We strongly recommend that users exercise caution and save all mission-critical data before installing or using this software.
From 7-Zip Software:
The main features of 7-Zip: High compression ratio in new 7z format with LZMA compression. Supported formats: Packing / unpacking: 7z, ZIP, GZIP, BZIP2 and TAR; Unpacking only: ARJ, CAB, CHM, CPIO, DEB, DMG, HFS, ISO, LZH, LZMA, MSI, NSIS, RAR, RPM, UDF, WIM, XAR and Z. For ZIP and GZIP formats 7-Zip provides compression ratio that is 2-10 % better than ratio provided by PKZip and WinZip. Self-extracting capability for 7z format. Integration with Windows Shell. Powerful File Manager. Powerful command line version.