22, linux- backup compression command gzip, tar, zip

A, gzip

1, -c: standard output, and retain the original file

For example: gzip -c b.txt> b.gz

 

 

2, -d: extract the compressed files, compressed package does not exist

 

 3, -r: progressively compressing or decompressing files

4, gunzip: unzip command, the equivalent of gzip -d

 

Two, tar command: compression packing

1, tar -cvf abc.tar a.txt b.txt c.txt: The a.txt b.txt c.txt packaged into abc.tar, retaining the original document and generates packet

2, tar -xvf path unpacked files solution path after the package

3, tar -zcvf abc.tar.gz a.txt b.txt c.txt: The a.txt b.txt c.txt packaged as a compressed abc.tar.gz, generating compressed and retained the original document

4, tar -zxvf unzip the file path: to extract the files to a specified directory

Note: tar can compress and decompress on the directories, gzip can compress and decompress the file

 

Three, zip compression command, unzip unzip command

Example: zip -r filename.zip file name / file directory: archive

Note: -r: represent progressive compression

Example: unzip filename.zip: Unzip the file

Guess you like

Origin www.cnblogs.com/z-xiao/p/11863867.html