Linux compression and Decompression command summary

Source: Internet
Author: User

First, tar.gz

Tar-xzvf


Second, tar.bz2

TAR.BZ2 Decompression Command

Bzip2-d gcc-4.1.0.tar.bz2
---the above and then execute the following command. After successful execution, a compressed package file that generates a. Tar is decompressed.
The next step is to extract it using the tar command.

TAR-XVF Gcc-4.1.0.tar or TAR-XVF *.tar
One more folder will appear after the solution is finished gcc-4.1.0

Note: Because it is GZ, you need to add Z. Pure. Tar does not need to add Z. So it's TAR-XVF.


Strange problems encountered:

TAR-XVFZ nagios-3.5.0.tar.gz

Error:

Tar:z: cannot open:no such file or directory
Tar:error isn't recoverable:exiting now

Instead: TAR-XZVF the decompression succeeds. It's just a Z-order for a change, not to the end.

Some people encounter this problem because Z is case-sensitive. Someone wrote a capital Z.

http://www.linuxdiyf.com/viewarticle.php?id=202439



Compress a directory or file

TAR-CF compressed file name object to compress

TAR-CF 2014-2-14.tar www.xeshh.com/

During the execution, the error:
Tar:www.xeshh.com/caches/error_log.php:file changed as we read it




-C represents crate, creating a compressed package. F indicates the next parameter to the file name, if decompressed, indicates the files to be decompressed. If compressed, represents the compressed file name.











Extract a file to the current directory
Tar-xzvf/var/www/php-5.5.18.tar.gz

Will extract the/var/www/php-5.5.18.tar.gz to the current directory.


Third, unzip the zip suffix of the package

Unzip xx.zip-d extract it to this directory.

I previously used the tar command to decompress the zip suffix of the compressed package. will be the error:

Gzip:stdin have more than one entry--rest ignored
Tar:child returned status 2
Tar: Exiting due to previous delay error

This is explained online:

The original tar was also indirectly called gzip, while the use of gzip is limited: Files created by Zip can uncompressed by gzip only if they has a single member compress Ed with the ' deflation ' method. That is, a single file with deflation compressed package can be extracted with gzip, fortunately there is workaround----unzip

Linux compression and Decompression command summary

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.