Linux Essentials-compression, decompression commands

Source: Internet
Author: User

Compression format: gz,bz2,xz,zip,z

  1. Compress:filename.z Early Compression commands

    Uncompress

  2. Gzip:. GZ can only compress files

    Gzip/path/to/somefile: The source file is deleted when compression is complete

    -D: Unzip

    -#:1-9 specifies that the compression ratio is 6 by default;

    Gunzip

    Gunzip/path/to/somefile.gz: The original file will be deleted when the decompression is complete

    Zcat/path/to/somefile.gz: In the case of no pressure, view the contents of the text file;

  3. Bzip2: .bz2  can only compress files

    Compression tool that is larger than gzip compression, uses a format similar to

         bzip2 / Path/to/somefile: The source file

             -k: Keep Compressed original file

              -#:1-9 specifies that the compression ratio is 6 by default;

          bunzip2  unzip

             bunzip2 /path/to/somefile.bz2 

         bcat/path/to/ somefile.bz2


  4. XZ:. XZ can only compress files

    Compression tool that is larger than gzip compression, uses a format similar to

    Xz/path/to/somefile: The source file is deleted when compression is complete

    -D: Unzip

    -K: Keep Compressed original file

    -#:1-9 specifies that the compression ratio is 6 by default;

    UNXZ Decompression

    Unxz/path/to/somefile.xz

    Xzdec Decompression

    Xzcat/path/to/somefile.xz

  5. Zip: Compressible directory, compression by default does not delete the original file (both archived and compressed)

    Zip filename.zip FILE1 FILE2 ...

    Zip Test.zip test/*

    Uzip: Unzip

  6. Tar: Archive tool (archive not compressed)

    -C: Create an archive file

    -F: Specify the Archive file name

    -X: Expand Archive file

    --xattrs: Preserve extended properties of files when archiving

    -T: Do not expand archiving to view archived files

    -V: Show more information


    -ZCF: Archive and invoke gzip compression

    -ZXF: Call gzip to unzip and expand archive-Z option to omit (same as below)


    -jcf:bzip2

    -JXF:

    -jcf:xz

    -JXF:



Linux Essentials-compression, decompression commands

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.