「アーカイブと圧縮」の版間の差分
ナビゲーションに移動
検索に移動
(前段を翻訳) |
(→Archiving only: ヒントを翻訳) |
||
30行目: | 30行目: | ||
{{Expansion|Are other compression algorithms such as lz4, lzop and zstd also supported by both implementations?}} |
{{Expansion|Are other compression algorithms such as lz4, lzop and zstd also supported by both implementations?}} |
||
+ | {{Tip|GNU とBSD tar はどちらも、 bzip2、 compress、 gzip、 lzip、 lzma、 および xz 圧縮アーカイブの解凍委任を自動的に実行します。 アーカイブを作成する場合、両方とも {{ic|-a}} スイッチをサポートして、ファイル拡張子に基づいて適切な圧縮プログラムを介して作成されたアーカイブを自動的にフィルタリングします。 BSD tar はフォーマットに基づいて圧縮フォーマットを認識しますが、 GNU tar はファイル拡張子に基づいて推測するだけです。}} |
||
− | {{Tip|Both GNU and BSD tar automatically do decompression delegation for bzip2, compress, gzip, lzip, lzma and xz compressed archives. When creating archives both support the {{ic|-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.}} |
||
− | + | こちらも参照 [[#Archiving only usage]] |
|
== Compression tools == |
== Compression tools == |
2020年11月23日 (月) 15:32時点における版
従来の Unix アーカイブおよび圧縮ツールは、UNIX哲学に従って分離されています。
- A ファイル アーカイバ は、複数のファイルを1つのアーカイブファイルに結合します。 tar
- A 圧縮 ツールはデータを圧縮および解凍します。 gzip
これらのツールは、最初にアーカイブファイルを作成し、次にそれを圧縮することによって順番に使用されることがよくあります。
もちろん、 それ以外にも暗号化、エラー検出、および回復を追加する tools もあります。
目次
Archiving only
Name | Package | Manuals | Description |
---|---|---|---|
GNU tar | tar | tar(1), info | Core utility for manipulating the ubiquitous tar archives (tarballs), which are used by pacman and the AUR. |
libarchive | libarchive | bsdtar(1) bsdcpio(1) |
Implementation of tar and cpio that also offers a library. Used by pacman and mkinitcpio. |
ar | binutils | ar(1) | Legacy Unix archiver before tar. Today only used for creating static library files. |
cpio | cpio | cpio(1) | File archiver via stdin/stdout, supports cpio and tar formats. |
DAR | darAUR | dar(1) | Archiver to backup large live filesystems, takes care of hard links, extended attributes, sparse files and inode types. |
こちらも参照 #Archiving only usage
Compression tools
Compression only
These compression programs implement their own file format.
Name | Package | Manual | Ext | Tar ext | Description | Parallel implementations |
---|---|---|---|---|---|---|
bzip2 | bzip2 | bzip2(1) | .bz2, .bz | .tbz2, .tbz | Uses the Burrows–Wheeler algorithm. | lbzip2, pbzip2 |
gzip | gzip | gzip(1) | .gz, .z | .tgz, .taz | GNU zip, based on DEFLATE algorithm. | pigz |
lrzip | lrzip | lrzip(1) | .lrz | Improved version of rzip, uses multiple algorithms. | is multithreaded | |
LZ4 | lz4 | lz4(1) | .lz4 | Written in C, focused on compression and decompression speed. | is multithreaded | |
lzip | lzip | lzip(1) | .lz | Uses LZMA. | plzipAUR | |
lzop | lzop | lzop(1) | .lzop | .tzo | Uses the LZO library (lzo). | |
xz | xz | xz(1) | .xz, .lzma | .txz, .tlz | Uses LZMA, default for GNU coreutils and kernel archive files. | is multithreaded, pixz, pxz-gitAUR |
zstd | zstd | zstd(1) | .zst | Uses Zstandard algorithm. | is multithreaded |
- Parallel implementations offer improved speeds by using multiple CPU cores.
- Tar extensions refers to compressed archives where
tar
and the compression tool is used, e.g..tzo
is.tar.lzo
. - See also #Compression only usage.
Archiving and compression
Name | Packages | Manuals | Ext | Description |
---|---|---|---|---|
7z | p7zip | 7z(1) | .7z | POSIX port of 7-zip's command-line. See p7zip. |
RAR | rarAUR, unrar | rar(1) | .rar | Both the format and the rar utility are proprietary. |
ZIP | zip, unzip | zip(1), unzip(1) | .zip | Widely used outside of the Linux world. |
Unarchiver | unarchiver | unar(1), lsar(1) | many | Command-line tool of a Mac application, supports over 40 archive formats. |
ZPAQ | zpaqAUR | zpaq(1) | .zpaq | A high compression ratio archiver written in C++, uses several algorithms. |
LHa | lhasa, lhaAUR | lha(1) | .lzh (on Amiga: .lha) | LZH/LHA archiver, supports the lh7-method. |
See also #Archiving and compression usage.
Feature charts
Decompress
Name | gzip | bzip2 | ZIP | LHa/LZH | compress | pack | CAB | ARJ |
---|---|---|---|---|---|---|---|---|
gzip | Yes | No | Yes | No | Yes | Yes | No | No |
p7zip | Yes | Yes | Yes | Yes | No | Yes | Yes | Yes |
unarchiver | Yes | Yes | Yes | Yes | Yes | No | Yes | partial |
Usage comparison
Archiving only usage
Name | Create archive | Extract archive | List content |
---|---|---|---|
tar(1) | tar cfv archive.tar file1 file2 |
tar xfv archive.tar |
tar -tvf archive.tar
|
cpio(1) | ls file1 file2 | cpio -o > archive.cpio |
cpio -i -vd < archive.cpio |
cpio -t < archive.cpio
|
Compression only usage
Name | Compress | Decompress | Decompress to stdout |
---|---|---|---|
bzip2(1) | bzip2 file |
bzip2 -d file.bz2 |
bzcat file.bz2
|
gzip(1) | gzip file |
gzip -d file.gz |
zcat file.gz
|
lrzip(1) | lrzip file lrztar folder |
lrzip -d file.lrz lrztar -d folder.tar.lrz |
lrzcat file.lrz
|
xz(1) | xz file |
xz -d file.xz |
xzcat file.xz
|
Archiving and compression usage
Name | Compress | Decompress | Decompress to stdout | List content |
---|---|---|---|---|
7z(1) | 7z a archive.7z file1 file2 |
7z x archive.7z |
7z e -so archive.7z file1 |
7z l archive.7z
|
rar(1) & unrar | rar a archive.rar file1 file2 |
rar x archive.rar |
rar p -inul archive.rar file1 |
rar l archive.rar
|
zip(1), unzip(1) | zip archive.zip file1 file2 |
unzip archive.zip |
unzip -p archive.zip file1 |
unzip -l archive.zip
|
lha(1) | lha ao7 archive.lzh file1 file2 |
lha x archive.lzh |
minimal: lha l archive.lzh verbose: lha v archive.lzh
|
Convenience tools
- atool — Script for managing file archives of various types.
- dtrx — An intelligent archive extraction tool.
- unp — Command line tool that can unpack archives easily.
- unpack — Wrapper script for handling multiple archive formats.
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 the file tool, see file(1).
Esoteric, rare or deprecated tools
Name | Packages | Ext | Description |
---|---|---|---|
ARC | arcAUR | .arc, .ark | Was very popular during the early days of the dial-up BBS. Superseded by ZIP. |
ARJ | arj | .arj | An archiver used on DOS/Windows in mid-1990s. This is an open source clone. |
compress | ncompress | .Z | The classic unix compression utility which can handle the ancient .Z archive. |
PAR2 | par2cmdline | .par2 | Parity archiver for increased data integrity. See also Parchive. |
shar | sharutils | .shar | Creates self-extracting archives that are valid shell scripts. |
Zoo | zooAUR | .zoo | Was mostly popular on the OpenVMS operating system before PKZIP became popular. |
Device mapper compression
There is work being done to mainline (integrate into the Linux kernel project) the recently 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
Compression libraries
- Brotli — Compression algorithm for data streams using the LZ77 algorithm, Huffman coding and 2nd order context modeling.
- 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.