. zip is a compressed file type common to Linux and Windows
Syntax: Zip [options] [Compressed files] [source files]
Example: [[email protected] yang]# zip install.log.zip install.log
Adding:install.log (deflated 9%)
Unzip extracting. zip Compressed Files
Syntax: unzip [options] [Compress files]
Example: [[email protected] yang]# unzip install.log.zip-d Hai
Archive:install.log.zip
Inflating:hai/install.log
-D is the directory where the extracted files are located
-O uncompressed without asking the user, overwriting the original file directly
Abbreviation for the gun zip at gzip, end of. GZ, often used for packaging compression
Syntax: gzip[-cdtv#] File name
-C: Output compressed data to the screen
-D: decompressed parameters
-T: Verifying the correctness of compressed files
-#: Compression level
Example: [[email protected] hai]# gzip Install.log
The source file is automatically deleted.
Unzip command
Gunzip and Gzip
Example: [[email protected] hai]# gzip-d install.log.gz
The source file is automatically deleted.
[Email protected] hai]# gunzip install.log.gz
3.BZIP2 more excellent compression ratio: bz2 end.
Syntax: bzip2[-cdkzv#] File name
Example: [[email protected] hai]# bzip2 Install.log
Automatically delete source files.
Unzip
Example: [[email protected] hai]# bzip2-d install.log.bz2
4.tar Packaging commands
Syntax: tar[-j][-z][cv][-f compressed file]filename packaging and compression
Tar[-j][-z][tv][-f compressed file] View file name
Tar[-j][-z][xv][-f compressed file][-c directory] Unzip
-C: New package file, with-V view the file name that is packaged
-T: See what the contents of the packaged file are
-X: Unpack and unpack
-J: Compressed/decompressed files via bzip2. tar.bz2
-Z: Compress/Unzip files via gzip. tar.gz
-V: Displays the file name being processed
-f:filename the files to be processed
-C: Specify the directory to decompress
Example: [[email protected] yang]# tar zcvf cs.tar.gz install.log passwd.txt users.txt
Or such example: [[email protected] yang]# tar-zcv-f cs1.tar.gz install.log passwd.txt users.txt
Unzip:
Example: [[email protected] yang]# tar zxvf cs.tar.gz-c/root/yang/hai/
Introduction to the Compression decompression command for Linux