1, gzip/bzip2/xz [-#] file, can only compress files, non-compressible directory.
Common parameters:
-#: Specify compression ratio 1-9, default is 6
-D: Expand, unzip
A. gzip,gunzip=gzip-d, the default compression has the original file deletion, decompression after the compressed file deletion.
-C: Output compression results to the screen, which can be saved as a compressed file using redirection, preserving the original file.
Gzip-c mmm > mmm.gz
Gzip mmm
Gzip-d mmm.gz
Do not press to view compressed files Zcat file
B. bzip2,bunzip2=bzip2-d
Do not press to view compressed files Bzcat file
c.xz,unxz=xz-d, higher compression ratio
Do not press to view compressed files Xzcat file
2, Zip ZipFile sourcefile can either compress the document or compress the directory. Expand: Unzip
The zip file.zip fileName, if it is a file, is compressed in this format.
Zip Dir.zip dir/*, if it is a directory, compressed in this format, note *, forget * The files in the directory will not be compressed into the compressed file.
3. Archive tar [option]-f file.tar file1 .... To archive multiple files as one file
-C: Create an archive
-X: Expand Archive
-T: Do not expand to view archived file contents
-Z: Call gzip
-j:bzip2
-j:xz
Therefore, the following three sets of parameters appear.
-zcf,-zxf
-jcf,-jxf
-jcf,-jxf
Note F is used to specify the file, F must be put to the last.
Linux compression, archiving tools