Common Linux compression and decompression commands

Source: Internet
Author: User
Tar (note: tar is packed, not compressed !) Unpack: tarxvfFileNametar package: tarcvfFileNametarDi

. Tar (note: tar is packed, not compressed !)

Unpack:

Tar xvf FileName.tar

Packaging:

Tar cvf FileName.tar DirName

. Gz

Extract 1:

Gunzip FileName.gz

Decompress 2:

Gzip-d FileName.gz

Compression:

Gzip FileName

.Tar.gz and. tgz

Decompress:

Tar zxvf FileName.tar.gz

Compression:

Tar zcvf FileName.tar.gz DirName

Use tar in combination with the find Command

Write the file name that is queried according to your own conditions to a file tmp. list.

Find/tmp-cmin + 24> tmp. list

Add all the files recorded in the file to the compressed package.

Tar-T tmp. list-czvf tmp.expire.tar.gz

. Bz2

Extract 1:

Bzip2-d FileName.bz2

Decompress 2:

Bunzip2 FileName.bz2

Compression:

Bzip2-z FileName

.Tar.bz2

Decompress:

Tar jxvf FileName.tar.bz2

Compression:

Tar jcvf FileName.tar.bz2 DirName

. Bz

Extract 1:

Bzip2-d FileName. bz

Decompress 2:

Bunzip2 FileName. bz

Compression: unknown

. Tar. bz

Decompress:

Tar jxvf FileName.tar. bz

Compression: unknown

. Z

Decompress:

Uncompress FileName. Z

Compression:

Compress FileName

. Tar. Z

Decompress:

Tar Zxvf FileName.tar. Z

Compression:

Tar Zcvf FileName.tar. Z DirName

. Zip

Decompress:

Unzip FileName.zip

Compression:

Zip-r FileName.zip DirName

. Rar

Decompress:

Rar x FileName.rar

Compression:

Rar a FileName.rar DirName

. Lha

Decompress:

Lha-e FileName. lha

Compression:

Lha-a FileName. lha FileName

. Rpm

Unpack:

Rpm2cpio FileName. rpm | cpio-div

Installation:

Rpm-ivh awstats-7.0-1.noarch.rpm

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.