Linux decompression command

Source: Internet
Author: User

Tar

-C: Create a compressed file

-X: Extract

-T: View content
-R: append an object to the end of the compressed archive object
-U: update files in the original compressed package

These five are independent commands, one of which must be used for compression and decompression. They can be used with other commands, but only one of them can be used.
The following parameters are optional when files are compressed or decompressed as needed.

-Z: With the gzip attribute
-J: With the bz2 attribute
-Z: With the compress attribute
-V: displays all processes.


-O: unbind the file to the standard output

The following parameter-F is required

-F: use the file name

Remember, this parameter is the last parameter, followed by only the file name.

# Tar-CF all.tar *. jpg




This command is to pack all. jpg files into a package named all.tar. -C indicates that a new package is generated.-F specifies the package file name.


# Tar-RF all.tar *. gif

This command adds all .gif files to the package of all.tar. -R indicates adding files.




# Tar-UF all.tar logo.gif
This command is used to update the logo.gif file in tarbao all.tar.-u indicates that the file is updated.

# Tar-TF all.tar
This command is used to list all files in the all.tar package.-T is used to list objects.

# Tar-XF all.tar
This command is used to extract all files in the all.tar package.-X is used to unlock the file.




 

 

Compression


 

 

Tar-CVF jpg.tar *. jpg
//
Set all
JPG
Package files
Tar. j
PG


 

 

 

Tar-CZF jpg.tar.gz *. jpg
//
Set all
JPG
Package files
Jpg.tar
And use it
Gzip
Compress to generate
Gzip
Compressed package named
Jpg.tar.gz


 

 

 

Tar-CJF jpg.tar.bz2 *. jpg
//
Set all
JPG
Package files
Jpg.tar
And use it
Bzip2
Compress to generate
Bzip2
Compressed package named
Jpg.tar.bz2


 

 

 

Tar-CZF jpg.tar. z *. jpg
//
Set all
JPG
Package files
Jpg.tar
And use it
Compress
Compress to generate
Umcompress
Compressed package named
Jpg.tar. Z


 

 

 

Rar a jpg.rar *. jpg // RAR
Format compression, which must be downloaded first
RAR for Linux


Download URL: http://www.rarlab.com/download.htm



 

 

Zip jpg.zip *. jpg // zip
Format compression, which must be downloaded first
Zip for Linux


 

 

 

 

Extract


 

 

Tar-xvf file.tar
//
Extract
Tar
Package


 

 

Tar-xzvf file.tar.gz
//
Extract
Tar.gz


 

 

Tar-xjvf file.tar.bz2
//
Extract
Tar.bz2


 

 

Tar-xzvf file.tar. Z
//
Extract
Tar. Z


 

 

Unrar e file.rar
//
Extract
RAR


 

 

Unzip file.zip //
Extract
Zip


 

 

 

 

Summary


 

 

1. *. Tar
Use
Tar-xvf
Extract


 

 

2. *. GZ
Use
Gzip-d
Or
Gunzip
Extract


 

 

3. * .tar.gz
And
*. Tgz
Use
Tar-xzf
Extract


 

 

4. *. bz2
Use
Bzip2-d
Or use
Bunzip2
Extract


 

 

5.*.tar.bz2
Use
Tar-xjf
Extract


 

 

6. *. Z
Use
Uncompress
Extract


 

 

7. *. Tar. Z
Use
Tar-xzf
Extract


 

 

8. *. rar
Use
Unrar E
Extract


 

 

9. *. Zip
Use
Unzip
Extract


 

Post from: http://blog.csdn.net/leo201592/archive/2008/03/13/2176268.aspx



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.