The compressed format of files in Linux is *.gz/*.bz2/*.xz/*.zip/*. Z, respectively, by Gzip, bZIP, XZ, zip, compress command compression obtained by gunzip/gzip-d, bunzip/bzip-d, xzdec/xz-d, unzip, uncompress decompression. *. Z or *.GZ/*.BZ2/*.XZ can use Zcat, bzcat, Xzcat command to view the contents of files in the compressed file without pressure.
Tar can implement file archiving similar to Cpio.
1.gzip:*.gz
gzip [-acdfhllnnrtvv#] [-s suffix] [name ...]
gzip–c filename > Filename.gz compress Keep source file, default compress delete original file
-d--decompress--uncompress: Extract
- R or--recursive: recursive processing
- V or--verbose: Show instruction execution Process
-#: (1-9) specify compression ratio, default is 6
Gunzip [-ACFHLLNNRTVV] [-s suffix] [name.gz ...]
gunzip–c filename.gz > FileName linux extract preserves source files, delete original files by default
Zcat [-FHLV] [name.gz ...] : View the contents of a file directly without being uncompressed
2.BZIP2: *.bz2----compression tool with a greater compression ratio than gzip, similar in usage
bzip2 [-cdfkqstvzvl123456789] [filenames ...] Delete the original file after the default compression
-D: Unzip
-C: Compression does not delete the original file, printed on the standard output
-#: (1-9) specify compression ratio, default is 6
-K: Compression is reserved for the original file
BUNZIP2 [-FKVSVL] [filenames.bz ...]
Delete original files after decompression
Bzcat [-S] [filenames ...]
View the contents of a file without decompressing
Bzip2recover filename: Recovering from a corrupted *.bz2
3.XZ:. XZ
XZ [option] ... [File] ...
-D: Uncompressed (equivalent to UNXZ)
-#: (1-9) specify compression ratio, default is 6
-K: Compression is reserved for the original file
Xzdec
-K: Keep the original file and print it to the screen
4.zip
Zip [[email protected]$] [--longoption ...] [-B Path] [-N suffixes] [-T Date] [-tt Date] [ZipFile [File ...]] [-xi List]
Common format: Zip file.zip fiel1 file2 ....
Zip tool can compress the directory, the above bZIP, GZIP2, XZ are not compressed directory, zip is first archived and then compressed, and compression is small, compression does not delete the original file.
5.tar [OPTION ...] [FILE] ... Generate *.tar Type file
- C: Create an archive file
-F File.tar Operation archive file
- x: Expand Archive
--xattrs: Preserves extended attribute information for files when archiving
- T: Directly view archived files without expanding the archive
-ZCF: Archive and invoke gzip compression
-ZXF: Call gzip to unzip and expand archive
-JCF: Archive and call bzip2 compression
-JXF: Call bzip2 to unzip and expand archive
-JCF: Archive and invoke XZ compression
-JXF: Call XZ to unzip and expand archive
-z/j/j option can be omitted, will automatically set the compression format, call the appropriate decompression tool decompression
This article is from the "A-filled blog" blog, please be sure to keep this source http://laizetian.blog.51cto.com/10728827/1700343
Compression decompression of Linux file management