Introduction to the Compression decompression command for Linux

Source: Internet
Author: User

  • . zip is a compressed file type common to Linux and Windows
    Syntax: Zip [options] [Compressed files] [source files]
    Example: [[email protected] yang]# zip install.log.zip install.log
    Adding:install.log (deflated 9%)

    Unzip extracting. zip Compressed Files
    Syntax: unzip [options] [Compress files]
    Example: [[email protected] yang]# unzip install.log.zip-d Hai
    Archive:install.log.zip
    Inflating:hai/install.log
    -D is the directory where the extracted files are located
    -O uncompressed without asking the user, overwriting the original file directly
  • Abbreviation for the gun zip at gzip, end of. GZ, often used for packaging compression
    Syntax: gzip[-cdtv#] File name
    -C: Output compressed data to the screen
    -D: decompressed parameters
    -T: Verifying the correctness of compressed files
    -#: Compression level
    Example: [[email protected] hai]# gzip Install.log

    The source file is automatically deleted.
    Unzip command
    Gunzip and Gzip
    Example: [[email protected] hai]# gzip-d install.log.gz

    The source file is automatically deleted.
    [Email protected] hai]# gunzip install.log.gz

    3.BZIP2 more excellent compression ratio: bz2 end.
    Syntax: bzip2[-cdkzv#] File name
    Example: [[email protected] hai]# bzip2 Install.log

    Automatically delete source files.
    Unzip
    Example: [[email protected] hai]# bzip2-d install.log.bz2

    4.tar Packaging commands
    Syntax: tar[-j][-z][cv][-f compressed file]filename packaging and compression
    Tar[-j][-z][tv][-f compressed file] View file name
    Tar[-j][-z][xv][-f compressed file][-c directory] Unzip
    -C: New package file, with-V view the file name that is packaged
    -T: See what the contents of the packaged file are
    -X: Unpack and unpack
    -J: Compressed/decompressed files via bzip2. tar.bz2
    -Z: Compress/Unzip files via gzip. tar.gz
    -V: Displays the file name being processed
    -f:filename the files to be processed
    -C: Specify the directory to decompress
    Example: [[email protected] yang]# tar zcvf cs.tar.gz install.log passwd.txt users.txt

    Or such example: [[email protected] yang]# tar-zcv-f cs1.tar.gz install.log passwd.txt users.txt

    Unzip:
    Example: [[email protected] yang]# tar zxvf cs.tar.gz-c/root/yang/hai/
  • Introduction to the Compression decompression command for Linux

    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.