Linux is commonly used in compression commands, if it is a folder to add-R
1.zip, unzip
2.gzip (the source file disappears after compression)
gzip + source File
GZIP–C ABC > abc.gz (-C command prevents the source file from disappearing).
Note: In the case of gzip compression, only sub-files in the directory are compressed.
Gzip–d, Gunzip + compressed file name decompression.
3.BZIP2 + source file (cannot compress directory)
The source file is not retained by default,-K can save the source file.
BUNZIP2 + Compressed Files Uncompressed default also does not retain the extracted files, plus-K reserved
4. Package command tar normal gzip and bzip2 not easy to compress the directory, or not at all, we can pack the directory before compression.
Format: TAR–CVF package file name source file
-C Packaging
-V Display procedure
-f Specifies the file name after packaging.
Pack and Compress first!
Unpacking: Change C to X
TAR–XVF Packaging files
Is it too much trouble to pack and compress first???? SSSs
In fact, the. tar.gz format is packaged first. tar re-compressed to. gz format
TAR–ZCVF compressed package name. tar.gz Source File
-Z indicates compression to. tar.gz format
TAR–ZXVF compressed package name. tar.gz
-X decompression. tar.gz
TAR–JCVF compressed package name. tar.bz2 Source File
-j indicates compression to. tar.bz2 format
TAR–JXVF compressed package name. tar.bz2
-X unzip. tar.bz2 format
Tar–c specifying the location of the decompression
Compress multiple Files space split
TAR–ZTVF Viewing compressed files
-C |
To compress |
-X |
To unzip |
-j |
Compressed files or extracted files are The. tar.bz2 format |
-Z |
Compressed files or extracted files are The. Tar.gzip format |
-T |
viewing compressed files |
Note In fact-Z,-j indicates compression into tar.bz2 or tar.gzip, when the decompression is said to decompress tar.bz2 or Tar.gzip?
Linux compression commands