Introduction to Linux decompression commands and use of decompression commands

Source: Internet
Author: User
Tags decompress zip

I. Introduction to decompression commands
Tar command
-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 and can only be followed by the file name.
# The tar-cf all.tar *. jpg command will be all. JPG files are packaged 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 will be all. The GIF file is added to the package of all.tar. -R indicates adding files.
# Tar-uf all.tar logo.gifthe command is a newer version of The logo.gif file in tarbao all.tar.tar.-u indicates the meaning of the update file.
# Tar-tf all.tarthis command is used to list all files in the all.tar package.-t is used to list objects.
# Tar-xf all.tarthis command is used to extract all files in the all.tar package.-x is used to unlock the files.
Ii. Use the compression command
Tar-cvf jpg.tar *. jpg // pack all jpg files in the Directory into tar.jpg tar-czf jpg.tar.gz *. jpgtar-cjf jpg.tar.bz2 *. jpg
// Configure

// Tar-cZf jpg.tar. Z *. jpgrar a jpg.rar *. jpg
// Token. Z

// For rar compression, download rar for linuxzip jpg.zip *. jpg first.
// Zip compression. You need to download the zip for linux
Iii. decompress the command
Tar-xvf file.tar // extract the tar package tar-xzvf file.tar.gz // decompress tar.gz tar-xjvf file.tar.bz2 // decompress tar.bz2 tar-xZvf file.tar. Z // decompress tar. zunrar e file.rar // decompress rarunzip file.zip // decompress zip 4,Summary
1. Decompress *. tar with tar-xvf
2. Use gzip-d or gunzip to decompress *. gz
3. Use tar-xzf to decompress * .tar.gz and *. tgz.
4. Use bzip2-d for *. bz2 or use bunzip2 for decompression.
5. Use tar-xjf to decompress * .tar.bz2
6. Use uncompress to decompress *. Z
7. Decompress *. tar. Z with tar-xZf
8. Extract files using unrar e for *. rar
9. Decompress *. zip with unzip

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.