(1) Packaging and compressing files
Packaged files in Linux generally end with. Tar, and compressed commands are usually terminated with. Gz.
In general, packaging and compression are carried out together, packaged and compressed files after the suffix name generally. tar.gz.
Command: TAR-ZCVF Package compressed file name to package compressed files
Where: Z: Invoke the gzip compression command for compression
C: Packaging files
V: Show Run process
F: Specify file name
Example: Package and compress all files under/test compressed package with the specified name of xxx.tar.gz
TAR-ZCVF xxx.tar.gz aaa.txt bbb.txt ccc.txt
Or: TAR-ZCVF xxx.tar.gz/test/*
(2) decompression compression package
Command: Tar [-ZXVF] Compressed file
Where: x: On behalf of decompression
you can not write Z, write z represents the specified compression method, you can automatically identify
Example: Extract the xxx.tar.gz under/test to the current directory
TAR-ZXVF xxx.tar.gz
Example: Extract the xxx.tar.gz under/test into the root directory/usr
TAR-XVF xxx.tar.gz-c/usr--c represents the location of the specified decompression