How to decompress tar in CentOS, gz, bz2, and other files

Source: Internet
Author: User
Tags uncompress
This section roughly summarizes the compression and decompression methods for various formats of compressed packages in linux. However, I have not used some of the methods. I hope you can help me with them. I will modify them at any time. thank you !. Tar decommission: tarxvfFileName.tar package: tarcvfFileName.tar DirName (note: t roughly summarizes the compression and decompression methods of various formats of compressed packages in linux. However, I have not used some of the methods. I hope you can help me with them. I will modify them at any time. thank you!. 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 FileName.tar.gz compression: tar zcvf FileName.tar.gz DirName ---------------. bz2 extract 1: bzip2-d unzip 2: bunzip2 FileName.bz2 compression: bzip2-z FileName .tar.bz2 Unzip: tar jxvf unzip or tar -- bzip xvf unzip compression: tar jcvf unzip DirName ---------------. bz extract 1: bzip2-d F IleName. bz extract 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 decompression: unzip FileName.zip compression: zip FileName.zip DirName: use the-r parameter to compress a directory and use-r recursion. Example: $ zip-r FileName.zip DirName ---------------. rar decompression: rar x FileName.rar compression: rar a FileName.rar DirName rar please go: http://www.rarsoft.com/download.htm Download! After decompression, copy rar_static to the/usr/bin directory (other directories specified by the $ PATH environment variable can also be used ): [root @ www2 tmp] # cp rar_static/usr/bin/rar ---------------. lha decompression: lha-e FileName. lha compression: lha-a FileName. lha FileName lha can go: http://www.infor.kanazawa-it.ac.jp/~ishii/lhaunix/ Download!> After decompression, copy lha to the/usr/bin directory (other directories specified by the $ PATH environment variable can also be used ): [root @ www2 tmp] # cp lha/usr/bin /---------------. rpm unpack: rpm2cpio FileName. rpm | cpio-div ---------------. deb unpack: ar p FileName. deb data.tar.gz | tar zxf ----------------. tar. tgz .tar.gz. tar. z. tar. bz .tar.bz2. zip. cpio. rpm. deb. slp. arj. rar. ace. lha. lzh. lzx. lzs. arc. sda. sfx. lnx. zoo. cab. kar. cpt. pit. sit. sea decompress: sEx x FileName. * pressure Contraction: sEx a FileName. * FileName sEx only calls the relevant program and does not support compression or decompression. please note! For sEx, go: http://sourceforge.net/projects/sex Download! After decompression, copy sEx to the/usr/bin directory (other directories specified by the $ PATH environment variable can also be used ): [root @ www2 tmp] # cp sEx/usr/bin/common file decompression methods and command System in Linux-System 1. to. a: # tar xv file. a 2. to. files with z extension: # uncompress file. Z 3.files with the extension of .gz: # files with the extension of gunzip file.gz 4..bz2: # bunzip2 file.bz2 5..tar. files with Z extension: # tar xvZf file.tar. Z or # compress-dc file.tar. Z | tar xvf 6.to .tar.gz /. files with the tgz extension: # tar xvzf file.tar.gz or gzip-dc file.tar.gz | tar xvf-7..tar. B Files with z2 extension: # tar xvIf file.tar.bz2 or bzip2-dc file.tar.bz2 | xvf-8.to .cpio.gz /. files with the cgz extension: # gzip-dc file. cgz | cpio-div 9. to. cpio/cpio: # cpio-div file. cpio or cpio-divc file. cpio 10. to. install files with the extension rpm: # rpm-I file. rpm 11. to. unzip the file with the extension rpm: # rpm2cpio file. rpm | cpio-div 12. to. install a file with the deb extension: # dpkg-I file. deb 13. to. decompress the file with the deb extension: # dpkg-deb-fsys-tarfile file. deb | tar xvf-ar p file. deb data.tar. Gz | tar xvzf-14.files with the extension of .zip: # unzip file.zip unzip Winzip files in linux. if jdk is installed, run the jar command. you can also run the unzip command. Directly decompress the. tar.gz file xxxx.tar.gz file using tar with the zxvf parameter, you can decompress it once. XXXX is the file name. For example, you can decompress the file extension of $ tar zxvf xxxx.tar.gz for various compressed files (installation method ). a ar xv file. a. Z uncompress file. z. gz gunzip file.gz. bz2 bunzip2 file.bz2. tar. Z tar xvZf file.tar. Z compress-dc file.tar. Z | tar xvf-.tar.gz /. tgz tar xvzf file.tar.gz gzip-dc file.tar.gz | tar xvf-.tar.bz2 tar xvIf file.tar.bz2 bzip2-dc file.tar.bz2 | xvf-.cpio.gz /. cgz gzip-dc file. cgz | cpio-div. cpio/cpio-div file. cpi O cpio-divc file. cpio. rpm/install rpm-I file. rpm. rpm/extract rpm2cpio file. rpm | cpio-div. deb/install dpkg-I file. deb. deb/exrtact dpkg-deb-fsys-tarfile file. deb | tar xvf-ar p file. deb data.tar.gz | tar xvzf -. zip unzip file.zip bzip2-d myfile.tar.bz2 | tar xvf tar xvfz myfile.tar.bz2 x is decompression v is complex output f is specified file z gz format gzip [option] to be compressed (or decompressed) file name-c writes the output to the standard output and retains the original file. -D: compress the compressed file. -L the following fields are displayed for each compressed file: size of the compressed file, the size, compression ratio, and name of the uncompressed file-r recursively searches for the specified directory and compresses or compresses all the files in it. -T to test whether the compressed file is complete. -V shows the file name and compression ratio of each compressed and decompressed file. -Num-adjust the compression speed with the specified number. Example: run/tar cvf usr.tar/home to/usr tar czvf usr.tar.gz/usr # tar cvf back.tar/back/# gzip-q back.tar or # tar cvfz back.tar.gz/back/empty. file. # Tar zxvf back.tar.gz # gzip back.tar.gz # tar xvf back.tar
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.