The traditional Unix archiving and compression tools are separated according to the Unix philosophy:
- A file archiver combines several files into one archive file, e.g. tar.
- A compression tool compresses and decompresses data, e.g. gzip.
These tools are often used in sequence by firstly creating an archive file and then compressing it.
Of course there are also tools that do both, which tend to additionally offer encryption, error detection and recovery.
|Core utility for manipulating the ubiquitous tar archives (tarballs), which are used by pacman and the AUR.
|Implementation of tar and cpio that also offers a library. Used by pacman and mkinitcpio.
|Legacy Unix archiver before tar. Today only used for creating static library files.
|File archiver via stdin/stdout, supports cpio and tar formats.
|Archiver to backup large live filesystems, takes care of hard links, extended attributes, sparse files and inode types.
-Ilz4). When creating archives both support the
-a switch to automatically filter the created archive through the right compression program based on the file extension. While BSD tar recognizes compression formats based on the format, GNU tar only guesses based on the file extension.
See also #Archiving only usage.
These compression programs implement their own file format.
|Uses the Burrows–Wheeler algorithm.
|Uses the Burrows–Wheeler algorithm.
|GNU zip, based on DEFLATE algorithm.
|, (part of AUR), AUR, AUR
|Improved version of rzip, uses multiple algorithms.
|Written in C, focused on compression and decompression speed.
|Can be multithreaded, though the https://lz4.github.io/lz4/ for alternatives.is not. See
|Uses the LZO library ( ).
|Uses LZMA2. Default for GNU and kernel archive files.
|Is multithreaded by default. An alternative is.
|Uses Zstandard algorithm.
- Parallel implementations offer improved speeds by using multiple CPU cores.
- Tar extensions refers to compressed archives where
tarand the compression tool is used, e.g.
- See also #Compression only usage.
Archiving and compression
|The third-party POSIX port of 7-zip's command-line.
|The upstream Linux version of a file archiver with a high compression ratio.
|Both the format and the rar utility are proprietary.
|Tar archiving utility in C with member-aligned zstd-compression
|Tar archiving utility in C++ with member-aligned lzip compression
|Widely used outside of the Linux world.
|Command-line tool of a Mac application, supports over 40 archive formats.
|A high compression ratio archiver written in C++, uses several algorithms.
|.lzh (on Amiga: .lha)
|LZH/LHA archiver, supports the lh7-method.
|Both the ACE file format and the archiving tool are proprietary.
See also #Archiving and compression usage.
Some of the tools above are capable of handling multiple formats, allowing for fewer installed packages.
- 's gunzip can only decompress single member ZIP files.
Archiving only usage
tar cfv archive.tar file1 file2
tar xfv archive.tar
tar -tvf archive.tar
ls file1 file2 | cpio -o > archive.cpio
cpio -i -vd < archive.cpio
cpio -t < archive.cpio
Compression only usage
|Decompress to stdout
bzip2 -d file.bz2
gzip -d file.gz
lrzip -d file.lrz
lrztar -d folder.tar.lrz
xz -d file.xz
Archiving and compression usage
|Decompress to stdout
7z a archive.7z file1 file2
7z x archive.7z
7z e -so archive.7z file1
7z l archive.7z
rar a archive.rar file1 file2
rar x archive.rar
rar p -inul archive.rar file1
rar l archive.rar
zip archive.zip file1 file2
unzip -p archive.zip file1
unzip -l archive.zip
lha ao7 archive.lzh file1 file2
lha x archive.lzh
lha l archive.lzh verbose:
lha v archive.lzh
- atool — Script for managing file archives of various types.
- dtrx — An intelligent archive extraction tool.
- J7Z — GUI for Linux in java which attempts to simplify data compression and backup. It can create 7z, BZip2, Zip, GZip, Tar archives.
- http://j7z.xavion.name || AUR
- ouch — A command line utility for easily compressing and decompressing files and directories
- unp — Command line tool that can unpack archives easily.
- unpack — Wrapper script for handling multiple archive formats.
- patool — Allows various archive types to be created, extracted, tested, listed, compared, searched and repacked.
Determining archive format
To extract an archive, its file format needs to be determined. If the file is properly named you can deduce its format from the file extension.
Otherwise you can use thetool, see .
Esoteric, rare or deprecated tools
|Was very popular during the early days of the dial-up BBS. Superseded by ZIP.
|An archiver used on DOS/Windows in mid-1990s. This is an open source clone.
|The de facto standard UNIX compression utility to success the Huffman-basedbefore gzip become a thing.
|Parity archiver for increased data integrity. See also Parchive.
|Creates self-extracting archives that are valid shell scripts.
|Was mostly popular on the OpenVMS operating system before PKZIP became popular.
File system compression
Some file systems support on-the-fly compression of file data:
- Btrfs can be configured to compress individual files, directories, or entire volumes by default.
- On ZFS, compression can be enabled on pools or file systems.
Device mapper compression
There is work being done to mainline (integrate into the Linux kernel project) the open-sourced VDO project, which provides a deduplication and compression device mapper layer in the interest of increasing storage efficiency. The following packages are available:
- vdo — Userspace tools for managing VDO volumes
- kvdo — A pair of kernel modules which provide pools of deduplicated and/or compressed block storage
- Brotli — Compression algorithm for data streams using the LZ77 algorithm, Huffman coding and 2nd order context modeling.
- libzip — Provides creation and extraction of ZIP files. Used by KDE and Deepin in place of the zip/unzip tools.
- zlib — Compression library implementing the deflate compression method found in gzip and PKZIP.
- Zopfli — High compress ratio file compressor from Google, using a deflate-compatible algorithm called zopfli.
Garbled Japanese Filenames
Japanese versions of Windows encode ZIP archives with Shift-JIS. By default, these archives will suffer from mojibake filenames when extracted. To extract properly, use unzip in the command-line using the shift-jis option.
$ unzip -O shift-jis nihongo.zip