Packaged under Linux compression and decompression
Compressed file suffix | *.gz | . * Bz2 | *.zip | *.rar | * .Tar.gz | * .tar.bz2 |
---|---|---|---|---|---|---|
Unzip command | gzip -d file.gz | bzip2 -d file.bz2 | ies file.zip/unzip file.zip | suicide file.rar | tar -zxv -f file.tar.gz | tar -jxv -F file.tar.bz2 |
Command Detailed
gzip
Common parameters
output -c compressed data to the screen, the data stream may be processed by the redirection, defined by the file name from the compressed or decompressed, -c filename as the gzip> lalala.gz
-d decompress
-t used check the consistency of a compressed file, the file has no judgment error
-v displays the original file and compression ratio between files and other information
- # select the compression level, -1 fastest, but worst compression ratio, -9 slowest, but the highest compression ratio, default -6
Simple compression command: gzip -v filename
bzip2
Common parameters
output data generated during -c compressed onto the screen, can be redirected, or custom-extracting compressed file name, such as: bzip2 filename> lalala.bz2 -c
-d decompress
-k retain the original file, decompressing but does not delete the original file
-z archive
-v displays the original file and the file compression ratio and other information
- # compression level, specific, like gzip
takes
tar is actually a packaged software, without compression parameters, then do not have the compression function.
Common parameters
-c new package file
-t package to view the contents of a file which contains the file name, mainly to see the file name
solution package -x or decompression functions
-j bzip2 compressed by supporting or decompressed, the file name of the best .tar.bz2 is *
the -z compressed using gzip support or decompressed, the file name is best .tar.gz *
-v compression or decompression process, the file name being displayed on the screen out
-f followed by the name of the file to be processed, is usually best to write a single parameter -f
-C decompression process, decompression operations specified directory
-p permissions and attributes reserved original backup data, used to back up important profile
-P retained absolute path, i.e. a path that permits the backup data containing the root directory
ies
Unzip the Linux system a good choice .rar compressed file, you can decompress zip, rar and other compressed files, through my own test, and some zip or rar file, garbled or with unzip unzip unrar will finally be able to unpack though, but after extracting file simply can not see, so I am concerned, unar replaced unzip and unrar.
Common parameter
-o specifies the archive directory or unzip
-f mandatory coverage when extracting files with the same name already exists in the document
when -r extracting file, if the file already exists, and rename the output file automatically
when -s-extracting file, if the file already exists then automatically skip
In this article the "Bird Brother Linux private kitchens", as well as man unar organize related content from, if any omissions, errors, please point out, thank you.