Common compression commands
. gz gzip Compression tool files
Files for the. bz2 bzip2 Compression Tool
. Tar Tar Packager package files (tar does not compress function, just merge a directory into one file)
The. Tar.gz can be understood to be packaged with tar first and then compressed in gzip
. tar.bz2 first packed in tar, compressed in bzip2
Gzip Compression Tool
Gzip does not support compressing directories, deleting source files after compression
# gzip [-d#] filename where # is 1-9 digits, compression level, 1 compression is the worst, 9 compression is best, 6 is the default
-D decompression is used
# Gunzip filename can also be decompressed
bZIP Compression Tool
bZIP does not support compression of directories
# bzip [-DKZ] filename
-D Decompression
-K Preserve Source files
-Z compression, do not add-Z can also compress files
# The TAR Pack tool can package a directory into a file for easy copying or moving
# tar [-ZJXCVFPP] filename
-Z Use gzip compression at the same time
-j simultaneous use of bzip compression
-X Unpack or unzip
-T view the files inside the tar package
-C Build a tar package or zip file package
-V Visualization
-F followed by the file name, compressed with "-F file name", meaning the compressed file name is filename, decompression with "-f filename", meaning decompression filename.-f need to write to the last
-P Use the properties of the original file, compress what attributes before compression or what properties
# TAR-ZCVF zhao.tar.gz Zhao #打包目录 Zhao and compressed to. gz format
# TAR-ZXCF zhao.tar.gz #解压缩 zhao.tar.gz
Zip compression tool
Windows Linux Universal
# zip [-R] [file or directory after compression]
-R Compression Directory
# unzip [compressed file]
Compression and decompression under Linux