Compression decompression under Linux

Source: Internet
Author: User
Tags rar uncompress

The most common packaging program under Linux is tar, which is often referred to as the TAR package, and the tar package file commands are usually terminated with. Tar. After the tar package is generated, you can use other programs to compress the   row, so first of all, the basic usage of the TAR command:  the TAR command has a lot of options (can be viewed with man tar), but there are a few options, the following   to illustrate:   # TAR-CF All.tar *.jpg  This command is to make all. jpg files into a package called All.tar. -C is the file name that represents the specified package that generated the new package  ,-f.   # TAR-RF All.tar *.gif  This command is to add all the. gif files to the All.tar package. -R is the   meaning of the added file.  # tar-uf All.tar logo.gif  This command is to update the original tar package All.tar in logo.gif file,-U is the meaning of the update file.    # TAR-TF all.tar  This command is to list all the files in the All.tar package,-T is to list the meaning of the file   # tar-xf all.tar  This command is to solve all the text in the All.tar package ,-X is the meaning of the undo   above is the most basic use of tar. Tar provides a special feature for users who can compress or decompress   files while packaging and unpacking the package. This is where tar can call other compression   scaling programs while packaging or unpacking, such as calling Gzip, bzip2, and so on.   1) Tar call gzip  gzip is a compression program developed by the GNU organization, and the. Gz end file is the result of gzip compression. The decompression procedure relative to gzip  is gunzip. Use the-Z parameter in tar to invoke gzip. Here is an example of  :  # TAR-CZF all.tar.gz *.jpg  This command is to make all. jpg files into a tar package and compress them in gzip to generate a  gzip compressed package. The package is named all.tar.gz  # tar-xzf all.tar.gz  This command unlocks the package generated above.   2) The TAR call bzip2  bzip2 is a more compressible compression program, and the. bz2 end of the file is the result of bzip2 compression.   BZIP2 relative to the decompression program is BUNZIP2. Use the-j parameter in tar to invoke gzip. Here is an example   description of:  # TAR-CJF all.tar.bz2 *.jpg  This command is to make all. jpg files into a tar package and compress them in bzip2 to generate a  BZIP2 compressed package. The package is named all.tar.bz2  # TAR-XJF all.tar.bz2  This command unlocks the package generated above.  3) Tar call compress  compress is also a compression program, but it seems that people who use compress are not as good as gzip and bzip2 people   more. The file at the end of Z is the result of bzip2 compression. The decompression procedure relative to compress is uncompress . Use the-Z parameter in tar to invoke compress. Here is an example of:  # TAR-CZF all.tar.z *.jpg  This command is to make all. jpg files into a tar package and compress them with compress, generate   a uncompress compressed package, Package named all.tar.z  # tar-xzf all.tar.z  This command is to untie the package generated above    with the above knowledge, you should be able to unlock a variety of compressed files, the following for the TAR series of compressed text    Pieces to make a summary:  1) file ending with. tar   TAR-XF all.tar  2) file ending with. gz   gzip-d all.gz  gunzip all.gz  3) file ending with. tgz or. tar.gz   TAR-XZF all.tar.gz  tar-xzf all.tgz  4) for. bz2 End of file   bzip2-d all.bz2&nbsp  ; BUNZIP2 all.bz2  5) for tar.bz2 end of file   TAR-XJF all.tar.bz2  6) for. Z End of File   uncompress all. z  7) for. Tar.z End of file   TAR-XZF all.tar.z   In addition for common compressed files under window. zip and. Rar,linux also have a corresponding way to decompress it  : &  nbsp 1) for .zip  Linux provides zip and unzip programs, ZIP is a compression program, unzip is the decompression program. They have a lot of arguments   options, here only to do a brief introduction, still illustrate its usage:  # zip all.zip *.jpg  This command is to compress all. jpg files into a zip package  # unzip all.zip&  nbsp This command extracts all the files in the All.zip.   2) for .rar  to process. rar files under Linux, you need to install RAR for Linux, which can be downloaded from the Web, but remember that RAR for Linux is not free ; rarfor Linux 3.2. 0 can be downloaded from http://www.rarsoft.com/download.htm and installed:  # TAR-XZPVF rarlinux-3.2.0.tar.gz   # CD rar  # make  so installed, after installation has RAR and unrar these two programs, RAR is a compression program, Unrar is the decompression program. They have a lot of parameter options, here only to do a brief introduction, still illustrate its usage:   # rar A All *.jpg  This command is to compress all. jpg files into a RAR package named All.rar, the program will. rar The   extension is automatically appended to the package name.   # Unrar e all.rar  This command is to extract all files from All.rar   to this, we have introduced the TAR, gzip, gunzip, bzip2, BUNZIP2, Compress, uncompress, zip, unzip, RAR, Unrar, and so on, you should already be able to use them for. Tar,. GZ,. tar.gz,. tgz,. bz2,. tar.bz2,. Z,. Tar. Z,. zip,. rar 10 Compression text   Pieces for decompression, should not need to download a software and do not know how to solve under Linux worry. And the above methods are basically effective for UNIX.   This article describes the programs that are compressed under Linux, such as tar, gzip, gunzip, bzip2, bunzip2, compress, uncompress, zip, unzip, RAR, Unrar, and how to use them for. Tar,. GZ,. tar.gz,. tgz,. bz2,. tar.bz2,. Z. Tar. Z,. zip,. rar 10 kinds of compressed files for   operation.    the following supplemental   tar  -c: Set up compressed archives  -x: Unzip  -t: View content  -r: Append files to the end of the compressed archive  - U: Update the files in the original package    these five are stand-alone commands that use one of the compression decompression, and can be used with other commands but only one. The following parameters are optional when compressing or extracting files as needed.   -z:  -j with gzip properties:  -z with bz2 properties: Compress with  -v properties: Show All Procedures  -o: Unpack the files to standard output    The following parameter-F is required  -f: Use the file name, remember that this parameter is the last parameter, can only be followed by the file name.  # tar-cf all.tar *.jpg This command is to make all. jpg files into a package named All.tar. -C is the file name that represents the generation of a new package,-f specifies the package.  # tar-rf All.tar *.gif  This command is to add all the. gif files to the All.tar package. -R is meant to increase the file.  # tar-uf All.tar logo.gif  This command is to update the original tar package All.tar in logo.gif file,-U is the meaning of the update file.  # TAR-TF all.tar  This command is to list all the files in the All.tar package,-T is to list the meaning of the file  # tar-xf all.tar  This command is to solve all the files in the All.tar package,-X is the meaningThink   compress  TAR–CVF Jpg.tar *.jpg//package all JPG files in the directory into TAR.JPG TAR–CZF jpg.tar.gz *.jpg// After packaging all the JPG files in the directory into Jpg.tar and compressing them in gzip, generate a gzip compressed package named JPG.TAR.GZ TAR–CJF jpg.tar.bz2 *.jpg// After packaging all the JPG files in the directory into Jpg.tar, and compressing them with bzip2, generate a bzip2 compressed package named JPG.TAR.BZ2 TAR–CZF Jpg.tar.z *.jpg// After packaging all the JPG files in the directory into Jpg.tar, and compressing them with compress, a umcompress compressed package is generated, named Jpg.tar.z rar a jpg.rar *.jpg//rar format compression, You need to download the RAR for linux zip jpg.zip *.jpg//zip format compression First, you need to download the zip for linux   decompression  TAR–XVF File.tar/unzip the TAR package &NB SP;TAR-XZVF file.tar.gz//decompression TAR.GZ TAR-XJVF file.tar.bz2//decompression TAR.BZ2 TAR–XZVF FILE.TAR.Z//Unzip tar. Z unrar e file.rar//decompression Rar unzip File.zip//Decompression zip   summary  1, *.tar with TAR–XVF decompression  2, *.gz with gzip-d or Gunzip decompression  3, *.tar.gz and *.tgz with Tar–xzf decompression  4, *.bz2 with bzip2-d or bunzip2 decompression  5, *.tar.bz2 with TAR–XJF decompression  6, *. Z extract  7, *.tar with uncompress. Z with Tar–xzf decompression  8, *.rar with Unrar e decompression  9, *.zip with unzip decompression   

Compression decompression under Linux

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.