Commonly used are 4 groups: GIZP, tar, zip, bzip2, listed below:
1. Compression command gzip
Can only be used to compress files, not to compress directories.
The original file will not be retained after compression.
2, decompression command gunzip
Another equivalence method is gzip-d [gz compressed file]
3. Packing Compression Command tar
Can be used to package compressed files or to package compressed directories.
The original file or directory is preserved after packaging is compressed.
It is not compressed until the parameter z is added, otherwise it is only packaged.
Example of packing a compressed directory: TAR-ZCF myfirst.tar.gz mydir/
4. Unpack and unzip the command tar
Compared to packing compression with the tar command, the difference between parameters is: packing with parameter C, unpacking parameters X
5. Compress command zip
Can be used to compress files, you can also compress the directory, you need to add parameters when compressing the directory R
The original file or directory is preserved after compression.
6. Decompression Command Unzip
7, Compression command bzip2
Can only be used to compress files.
This is an upgrade version of the gzip command, compared to zip compression, its compression ratio is more significant, generally used to compress large files, and can be set to save the original file.
The parameter k is used to indicate the retention of the original file, and Gzip never retains the original file. K denotes keep.
Can be used in conjunction with the tar command, TAR-CJF xxx.tar.bz2 mydir/indicates that the directory Mydir packed into bz2 format files. Note that this is J, not Z.
8. Decompression Command BUNZIP2
Can be used in conjunction with the tar command, TAR-XJF xxx.tar.bz2 mydir/represents the uncompressed file xxx.tar.bz2. Note that this is J, not Z.
Linux Learning Compression Decompression command