How to decompress and package commands in linux

Source: Internet
Author: User
Tags gz file

Linux decompress and package command Daquan gzip command to reduce the file size has two obvious advantages, one is to reduce the storage space, the other is through the network to transfer files, can reduce the transmission time. Gzip is a frequently used command in Linux to compress and decompress files, which is convenient and easy to use. Www.2cto.com Syntax: gzip [Option] compressed (decompressed) file name the meaning of each option of this command is as follows:-c writes the output to the standard output, and retains the original file. -D. decompress the compressed file. -L the following fields are displayed for each compressed file: size of the compressed file, size of the uncompressed file, and compression ratio; name of the uncompressed file-r recursively searches for the specified directory and compresses all the files or decompress them. -T test to check whether the compressed file is complete. -V displays the file name and compression ratio for each compressed and decompressed file. -Num uses the specified numeric num to adjust the compression speed.-1 or-fast indicates the fastest compression method (low compression ratio), and-9 or-best indicates the slowest compression method (high compression ratio ). The default value is 6. Command instance: gzip * % compresses each file in the current directory into A. gz file. Gzip-dv * % decompress each compressed file in the current directory and list detailed information. Gzip-l * % detailed information of each compressed file in Example 1 is displayed without decompression. Gzip usr.tar %: the compressed tar backup file usr.tar. the extension name of the compressed file is .tar.gz .. Tar unpack: tar xvf FileName.tar package: tar cvf FileName.tar DirName (Note: tar is packed, not compressed !). Gz decompression 1: gunzip FileName.gz decompression 2: gzip-d FileName.gz compression: gzip FileName.tar.gz and. tgz decompression: tar zxvf unzip compression: tar zcvf FileName.tar.gz DirName.bz2 decompression 1: bzip2-d FileName.bz2 decompression 2: bunzip2 FileName.bz2 compression: bzip2-z unzip: tar jxvf unzip compression: tar jcvf FileName.tar.bz2 DirName. bz extract 1: bzip2-d FileName. bz extract 2: bunzip2 FileName. bz compression: Unknown .tar. bz decompress: tar jxvf FileName.tar. bz compression: unknown. decompress Z: uncompress FileNa Me. Z compression: compress FileName.tar. Z decompress: tar Zxvf FileName.tar. Z compression: tar Zcvf FileName.tar. Z DirName.zip unzip: unzip FileName.zip zip: zip FileName.zip DirName.rar unzip: rar x FileName.rar compressed: rar a FileName.rar DirName. lha decompression: lha-e FileName. lha compression: lha-a FileName. lha FileName. rpm unpack: rpm2cpio FileName. rpm | cpio-div. deb unpack: dpkg-deb-fsys-tarfile ***. deb | tar xvf-if the dpkg-deb command is not available, you can use: ar-x ***. deb. Two tar packages are displayed. You can use tar to unpackage.

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.