Linux under these compression, archive commands---you have to be

Source: Internet
Author: User

One, the common compression/decompression tool:compress/uncompress suffix:. zgzip/gunzip suffix:. GZbzip2/bunzip2 suffix:. bz2zip/unzip suffix:. zip The first kind of compress is already less common, and three of the following are now popular compression/decompression toolsTwo, the use of specific
gzip #gzip filename//Compresses a file, but the original file is deleted after compression#gunzip filename.gz//extracted. gz files will be deleted#gzip-D filename.gz//equivalent to command gunzip file.gz #gzip-c filename >> filename.gz//used to compress the original file and retain the original file#gzip-n filename//Custom compression level (the higher the level <1-9> the higher the compression ratio, but the slower the default is 6)View the contents of a compressed file #zcat filename.gz// uncompressed NOTE: gzip cannot compress the directory (if you compress the directory, the files in the directory are compressed individually )  bZIP: Its compression ratio is larger than that of gzip, and the format is almost similar to gzip, with a different number of places   #bzip2-k filename//compress to retain the original file#bzip2-K filename.bz2//Unzip to keep the original file#bzcat filename.bz2//without decompression to view compressed file contents directly bZIP can also be compressed only on individual files and cannot compress directories     Zip: Can be archived and compressed at the same time#zip message.zip file1 file2 file3//compress several files in one file at the same time(compression does not delete the original file, of course, after decompression does not delete the original compressed file) zip This tool can compress the directory, the compressed name can be specified by their own tar: File archive command (itself does not do any compression) #tar-cf message.tar file2 file2 file3 file4//must specify the file name after the archive (this is similar to zip-C: Archive-F: Specify the file name)#tar-TF File.tar//View the contents of an archive file#tar-xf file.tat//Expand the contents of the archive file#tar-cvf filename.tar file1 file2 file3//Archive These three files,-V: Displays the archive process information              #tar-XVF Filename.tar//Expand the archive and show the process  Three: Archiving tools for use with tar and GZIP,BZIP2#tar-zcvf filename.tar.gz file1 file2 file3//Archive and compress these three files#tar-ZXVF message.tar.gz//Decompression and "solution file"#tar-jcvf filename.tar.bz2 file1 file2 file3//This is the common use of tar and bzip2 #tar-JXVF filename.tar.bz2//Decompression and "solution file" Now the TAR tool can determine its own use of gzip or bzip2, so we can use the #tar-xf directly when extracting filename.tar.gz #tar-xf message.tar.bz2-c/var/tmp//-c: Define your own unzipped directory, default is the current directory
Cpio: is also an ancient archive file, the options are many, the use of specific methods later on.

Linux under these compression, archive commands---you have to be

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.