7-zip is a file compressor with a high ratio of compression. The main features are:
- High ratio of compression (LZMA algorithm)
- Compress / decompress: 7z, ZIP, GZIP, BZIP2 and TAR
- Unzip: ARJ, CAB, CHM, CPIO, DEB, DMG, HFS, ISO, LZH, LZMA, MSI, NSIS, RAR, RPM, UDF, WIM, XAR and Z
- Robust encryption: AES-256 for 7z and ZIP formats
- Allows to create self-extracting archives (SFX)
- Command line version
- Integration with File Roller, XArchiver and XArchive
- Multi-platform
- Multi-language
p7zip is a port of 7-Zip for Unix
Install p7zip
Fedora
# yum -y install pzip p7zip-plugins
Debian / Ubuntu
# apt-get install p7zip-full
Synopsis
$ 7z <commands> [] [ - ] [switch] <archive-name> <arguments> [ficheros a compactar]
- Commands
- a: Add files to archive
- b: Benchmark
- d: deletes files from the archive
- l: list the contents of the archive
- t: integrity verification
- u: update files in the archive
- x: extract files while keeping the directory structure
- switch (all are not exposed for more info type 7z –help)
- -m {parameters}: sets the compression method
- -mhe = on|off: enables / disables encryption (only for 7z format)
- -o: directory where is to unpack the files, by default the current directory
- -p {password}: sets password
- -sfx: creates self-extracting files
- -si: Gets the data from the standard output
- -so: dumps data to the standard output
- -slt: shows technical information for the command l (list)
- -t: Set type of archive
- -v {Size}[b|k|m|g]: creating volumes
- -y: assume Yes in all queries
Examples
Maximum compression, lzma method
$ 7z a -t7z -m0=lzma -mx=9 flossblog.7z flossblog
- Where:
- -t7z: 7z format
- -m0=lzma: LZMA method
- -mx=9: maximum level of compression
Unzip flossblog.7z to your projects directory
$ 7z x flossblog.7z -oproyectos
Self-extracting
$ 7z a -sfx flossblog.exe flossblog
In order to run the self-extracting type
$ ./flossblog.exe
Create volumes
$ 7z a -v1M flossblog.7z flossblog
Encrypt data and header
$ 7z a -mhe=on -pmy-passwd flossblog.7z flossblog