The compression formats commonly used in Linux are. zip. gz. bz2. tar.gz. tar.bz2
One,. zip
1. Command format
Zip compressed filename source file name (zip file to current directory)
Zip-r compressed file name source directory name (compressed directory file to current directory)
Unzip compressed file name (unzip. zip file to current directory)
Description: Compressed files in the. zip format are common in Linux and Windows, and when the source files are compared for hours, compressed files may be larger than the original (compressed format conversion)
Ii.. gz
1. Command format
Gzip source files (compress files to current directory, source files are deleted)
Gzip-c source Files > Compressed files (compressed files to the current directory, with output redirection for source file retention)
Gzip-r directory (all files in the specified directory are compressed)
gzip-d compressed file (unzip the file to the current directory, the source file is deleted)
Gunzip Compressed Files ()
Description: the. gz format files in Linux can be decompressed in Windows
Iii.. bz2
1. Command format
bzip2 source files (source files are not preserved)
Bzip2-k source files (keep source files after compression)
bzip2-d compressed files (uncompressed, not preserving compressed files,-K preserving compressed files)
BUNZIP2 compressed files (uncompressed, not preserving compressed files,-K preserving compressed files)
Note: The bZIP command cannot compress the directory
Iv.. tar.gz
1.tar Command (Package command)
Command format: TAR-CVF package file name source file (-C package,-V display procedure,-f specifies the file name after packaging)
TAR-XVF Package file name (-X unpacking)
2.TAR.GZ (packaged and compressed)
Command format: TAR-ZCVF compressed package name. tar.gz source file (-Z compression to. tar.gz format)
TAR-ZXVF compressed package name. tar.gz (-X extract. tar.gz format)
TAR-ZCVF Path/Zip package name. tar.gz Source file 1 source file 2 (compresses multiple files individually to the. tar.gz format under the specified path)
TAR-ZTVF compressed package name. tar.gz (-t-Test to view files within a compressed package)
V.. tar.bz2
1. Command format
TAR-JCVF compressed package name. tar.bz2 source file (compressed to. tar.bz2 format)
TAR-JXVF compressed package name. TAR.BZ2 (uncompressed. tar.bz2 format)
TAR-JXVF compressed package name. Tar.bz2-c path (extracted to the specified path)
Common compression and decompression commands in Linux