Linux tar, gz, bz2 and other decompression file usage methods

  
 

.tar

  • Unpacking: tar xvf FileName.tar
  • Packaging: tar cvf FileName.tar DirName

    (Note: tar is Packing, not compression!)

    ———————————————

    .gz

  • Unpack 1:gunzip FileName.gz
  • Unzip 2:gzip -d FileName.gz
  • Compress: gzip FileName
  • .tar. Gz and .tgz
  • Extract: tar zxvf FileName.tar.gz
  • Compression: tar zcvf FileName.tar.gz DirName

    ——— ————————————

    .bz2

  • Unpack 1:bzip2 -d FileName.bz2
  • Unpack 2:bunzip2 FileName.bz2
  • Compress: bzip2 -z FileName
  • .tar.bz2
  • Unzip: tar jxvf FileName.tar.bz2 Or tar --bzip xvf FileName.tar.bz2
  • Compression: tar jcvf FileName.tar.bz2 DirName

    ——————&mdash ;————————

    .bz

  • Unpack 1:bzip2 -d FileName.bz
  • Unzip 2:bunzip2 FileName.bz

    .tar.bz

  • Unpacking: tar jxvf FileName.tar.bz

    —— —————————————

    .Z

  • Unpacking: uncompress FileName.Z< Br>
  • Compression: compress FileName

    .tar.Z

  • Unpacking: tar Zxvf FileName.tar.Z
  • Compression: tar Zcvf FileName.tar.Z DirName

    ———————————————

    .zip

  • Unzip: unzip FileName.zip
  • Compress: zip FileName.zip DirName
  • Compress a directory with the -r parameter, -r recursively. Example: $ zip -r FileName.zip DirName

    ———————————————< Br>

    .rar

    Extract: rar x FileName.rar

    Compression: rar a FileName.rar DirName

    rarPlease go to: http://www. Rarsoft.com/download.htm Download!

    Please copy rar_static to the /usr/bin directory after decompression (other directories specified by the $PATH environment variable):

    [root@www2 tmp]# cp rar_static /usr/Bin/rar

    ———————————————

    .lha

  • Extract: lha -e FileName.lha
  • Compression: lha -a FileName.lha FileName

    —————— —————————

    .rpm

  • Unpacking: rpm2cpio FileName.rpm
  • Copyright © Windows knowledge All Rights Reserved