Compression and decompression under Linux

Source: Internet
Author: User
Tags pack

[Tar detailed : ]

- C: Create compressed Archives- x: Unzip- t: View content- R: Append files to the end of a compressed archive file-u: Update files in original compressed packageThese five are stand-alone commands, which use one of the compression decompression, and can be used with other commands but only one.
The following parameters are optional when compressing or decompressing a file as needed:
-Z: With gzip properties-j: With the bz2 attribute-Z: With the Compress attribute- V: Show All procedures- o: Unpack the file to standard output

The following parameter-F is required

- F: Using the file name , Remember that this parameter is the last parameter and 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 adds 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 the logo.gif file,-U is to indicate 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 meaning


[zip file : ]

TAR–CVF Jpg.tar *.jpg # package All JPG files in the directory into tar.jpg

TAR–CZF jpg.tar.gz *.jpg # Pack All the JPG files in the directory into Jpg.tar and compress them in gzip to generate a gzip compressed package named jpg.tar.gz

TAR–CJF jpg.tar.bz2 *.jpg # Pack All the JPG files in the directory into Jpg.tar and compress them in bzip2 to generate a bzip2 compressed package named jpg.tar.bz2

TAR–CZF jpg.tar.z *.jpg # Pack All the JPG files in the directory into Jpg.tar and compress them in compress to generate a umcompress compressed package named Jpg.tar.z

RAR a jpg.rar *.jpg # rar format compression, need to download RAR for Linux first

Zip jpg.zip *.jpg # ZIP format compression, need to download zip for Linux First


[Unzip file : ]

TAR–XVF File.tar # unzip the tar package

TAR-XZVF file.tar.gz # Decompression tar.gz

TAR-XJVF file.tar.bz2 # Decompression tar.bz2

TAR–XZVF File.tar.z # Unzip the tar. Z

Unrar e File.rar # decompression rar

Unzip File.zip # unzip Zip


[summary : ]

. tar
Decompression: Tar zxvf Filename.tar
Compression: Tar czvf filename.tar DirName
---------------------------------------------
. gz
Decompression 1:gunzip filename.gz
Decompression 2:gzip-d filename.gz
Compression: gzip FileName

. tar.gz and. tgz
Decompression: Tar zxvf FileName.tar.gz
Compression: Tar zcvf FileName.tar.gz DirName
---------------------------------------------
. bz2
Decompression 1:bzip2-d filename.bz2
Decompression 2:BUNZIP2 filename.bz2
Compression: Bzip2-z FileName

. tar.bz2
Decompression: Tar jxvf FileName.tar.bz2
Compression: Tar jcvf FileName.tar.bz2 DirName
---------------------------------------------
. BZ
Decompression 1:bzip2-d filename.bz
Decompression 2:BUNZIP2 filename.bz
Compression: Unknown

. tar.bz
Decompression: Tar jxvf FileName.tar.bz
Compression: Unknown
---------------------------------------------
. Z
Decompression: uncompress filename.z
Compression: Compress FileName

. Tar. Z
Decompression: Tar zxvf filename.tar.z
Compression: Tar zcvf filename.tar.z DirName
---------------------------------------------
. zip
Decompression: Unzip Filename.zip
Compression: Zip Filename.zip DirName
---------------------------------------------
. rar
Decompression: rar a Filename.rar
Compression: R ar e filename.rar
  
RAR please to: http://www.rarsoft.com/download.htm download!
After extracting, copy the rar_static to the/usr/bin directory (other directories specified by the $PATH environment variable are also available):
CP Rar_static/usr/bin/rar
---------------------------------------------
. Lha
Decompression: Lha-e Filename.lha
Compression: Lha-a Filename.lha FileName
  
LHA please go to: http://www.infor.kanazawa-it.ac.jp/~ishii/lhaunix/download!
> After unpacking, copy the LHA to the/usr/bin directory (other directories specified by the $PATH environment variable are also available):
CP lha/usr/bin/
---------------------------------------------
. rpm
Decompression: Rpm2cpio filename.rpm | Cpio-div
---------------------------------------------
. deb
Decompression: ar p filename.deb data.tar.gz | Tar zxf-
---------------------------------------------




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.