File and file system compression and packaging

Source: Internet
Author: User

compression command: Compress gzip bzip2 zipCompress (the command is obsolete):
    1. compress-v xxx (-V: Show progress), after compression xxx files will disappear and be replaced with XXX.Z
    2. Compress-c-V xxx > xxx.z (-C: Source files are still retained after being compressed)
    3. Uncompress xxx.z (Uncompressed)
gzip:
    1. gzip xxx (compression xxx, generate xxx.gz,xxx disappears)
    2. Zcat xxx.gz (View the contents of the compressed file)
    3. Gzip-d xxx.gz (-D: extracting xxx.gz)
    4. gzip-c xxx > xxx.gz (compressed source file still exists)
bzip2:
    1. bzip2 xxx (compression xxx, generate xxx.bz2,xxx disappears)
    2. Bzcat xxx.bz2 (View the contents of the compressed file)
    3. Bzip2-d xxx.bz2 (-D: extracting xxx.bz2)
    4. bzip2-c xxx > xxx.bz2 (compressed source file still exists)
    5. LS-1H (View the size of the compressed file)
Zip:
    1. Zip xxx.zip xxx (compression xxx for xxx.zip)
    2. Unzip Xxx.zip (decompression xxx.zip)
Packaging Command (TAR): packaging itself does not have the compression function, the archive function, after the archive due to the extra pocket, the size will become larger, will not shrink
    1. Package: Tar cvf xxx.tar xxx (c:create;v--shows the progress of the archive; f--indicates the name after the archive)
    2. Note: The source file is retained after archiving, if you do not want to keep the source file, followed by the--remove-files parameter: tar cvf xxx.tar xxx--remove-files
    3. In the case of an unsolved document, you want to see what files are in the. tar package: Tar TVF Xxx.tar
    4. Solution (default file to current folder): Tar xvf Xxx.tar
    5. Solution to the specified directory, plus the large C parameter: Tar xvf xxx.tar-c aa/
    6. Package all files under the current directory: Tar cvf Xxx.tar *--remove-files
    7. Extract only some of the files in the Xxx.tar: First Use tar TVF Xxx.tar to see what files are in the tar package, and then use tar xvf xxx.tar partofxxx
    8. In the packaging process also want to compress, with gzip (plus z parameter) or bzip2 (plus the J parameter), also support to extract only some files, extract into the specified directory, can be combined with
    9. Use gzip, such as: Tar zcvf xx.tar.gz * (--remove-files) and unzip: Tar zxvf xx.tar.gz
    10. Use bzip2, such as: Tar JCVF xx.tar.bz2 * Unzip and unzip: Tar jxvf xx.tar.bz2

File and file system compression and packaging

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.