Compression and decompression:
Compression format: gz,bz2,xz,zip,z
Compression algorithm: Compression algorithm is different, compression ratio will be different, the compression algorithm is not discussed here
Compression and decompression of files
Gzip: *.gz
Gzip/path/file_name: The original file is deleted when the compression is complete
-D: Unzip
-#: Compression ratio (1-9), default = 6
Gunzip: ==> gzip-d
gunzip/path/file_name.gz: Delete original file after decompression
Zcat/path/file_name.gz: View the contents of a compressed text file without being pressed
BZIP2: *.bz2
Greater compression ratio than gzip
Bzip2/path/file_name
-D: Unzip
-#: Compression ratio 1-9, default 6
-K: Keep the original file when compressing
BUNZIP2: Decompression
bunzip2/path/file_name.bz2
bzcat/path/file_name.bz2
XZ: *.xz
Xz/path/file_name
-D: Unzip
-#: Compression ratio 1-9 Default 6
-K: Keep the original file when compressing
Unxz/path/file_name.xz
Xzcat/path/file_name.xz
Archive, the archive itself does not imply a compression
Zip: Package compression, do not delete the original file after compression
Zip file_name.zip file1 file2 ...
Unzip
Unzip File_name.zip
Tar: Archive tool
-F File.tar: Archived files for operations
-C: Create an archive file
-X: Expand Archive
--xattrs: Preserve extended attribute information when archiving
-T: Do not expand archive to see which files are archived
-Z: Call gzip
-ZCF: Archive and use gzip compression
-ZXF: Unzip and expand the archive using gzip
-j:bzip2
-j:xz
Linux_ file compression and archiving