Commands for the Linux server to decompress files

Source: Internet
Author: User
Tags bz2 rar

Try to get started with Linux and beginners. This side will only mention I have used, and other relevant later I use I will add. If there is a mistake welcome correct

Note: 1, c create-create

  2, v-Complex output

3. F-File-file

4. x-Decompression-extract

5. Z-gz format

66666, really do not use the syntax of the man ... For example, man tar, he's going to give you some real-world tar parameters operation

. tar

Package syntax: Tar cvf newfilename.tar fileName | | DirName

Unpacking syntax: Tar xvf newfilename.tar fileName (-c dirName)

Explanation: 1, this is the file packaging (not related to compression)

2, the back if add-C dirname the words on behalf of unpack (the following about the tar are exhausted) after the dirname this path to the folder below

3, newfilename refers to the file name of the package after the filename of filename filename, if there are multiple files can be written in parallel, and with "" space separated; If you use dirname, then pack that folder (with the file inside)

. tar.gz

Compression:

Method 1 tar czvf newfileName.tar.gz fileName | | DirName

Method 2 tar cvf Tmpfilename.tar fileName | |     DirName (just want to pack into. tar); Gzip-v Tmpfilename.tar (Delete source file, become tmpfileName.tar.gz, and display compression ratio---If-V is written as-Q does not display compression ratio);

Extract:

1. Tar zxvf fileName

2, Tar xvf fileName (pro-test can also)

3, gzip-d fileName.tar.gz; Tar xvf fileName

Explanation: Compression when two ways, in fact, the first enough, the second is step-by, first pack into tar, and then use gzip compression into. tar.gz format, recommended first. Unzip just the opposite

Gzip that does not show compression ratio

Is that it? a.php compressed into. tar.gz

Direct decompression shows the a.php

This shows the compression ratio.

Decompression e.tar.gz

. bz2

Compression:

Method 1, Tar jcvf fileName.tar.bz2 fileName

Method 2, Bzip2-z fileName.tar.bz2 Filename.tar

Unzip:

Method 1, Tar jxvf fileName.tar.bz2

Method 2, Bzip2-d fileName.tar.bz2; Tar xvf Filename.tar

Note: The simple test in the computer passed ... Please correct me if there is an error.

. zip

Compression: Tar xvf filename.zip fileName

Decompression: Upzip Filename.zip

. rpm

Decompression: Rpm2cpio filename.rpm | Cpio-div

. rar

Today accidentally downloaded a rar file = =

Since Linux does not have the method of extracting RAR, so download a http://down.itlearner.com/soft/2412.shtml

When make is installed.

Compression: rar a FileName

Decompression: rar x Filename.rar

Commands for the Linux server to decompress files

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.