Linux learning essay-compression and decompression, linux essay

Source: Internet
Author: User

Linux learning essay-compression and decompression, linux essay

. Gz files compressed by gzip

. Bz2 files compressed by bzip2 compression Tool . Tar files packaged by the tar package .Tar.gz is first packaged by tar and compressed by gzip. .Tar.bz2 is first packaged by tar and compressed by bzip2 1: gzip file compression this command cannot compress Directories Gzip + the file is compressed at the current position. gzip cannot compress the directory. # Gzip 1.txt Convert the compressed source file to 1.txt.gz. Gzip-d file name indicates Decompression # Gzip-d 1.txt.gz unzip and restore the file to 1.txt 2: bzip2 this command cannot compress Directories # Bzip2 1.txt Compression # Bzip2-d 1.txt.bz2 Extract 3: The tar compression tool can package and decompress directories and files simultaneously. # Tar-cvf test.tar test/-c create a compressed package-v visualization-f compressed file name test/indicates the compressed directory or file # Extract the 1.txt.tar file from tar-xvf 1.txt.tar 3.1: The-z option is required for gzip compression during packaging. # Tar-czvf test.gz test/package the test directory and use gzip for compression # Tar-xzvf test.gz-xzvf gzip package 3.2: During packaging, bzip2 only needs to be compressed with-j # Tar-cjvf test.tar.bz2 test compressed test directory test.tar.bz2 use bzip2 Compression # Tar-xjvf test.tar.bz2 decompression note-j is used here because the bz2 compressed package is decompressed 4: zip compression can be used to compress directories and files. When compressing directories, you must specify the files under the compression directory. # Zip 1.txt.zip 1.txt compressing a single file # Unzip 1.txt.zip unzip a single file 4.1 when you use the zip command to compress a directory, if there is a second-level directory under the first-level directory. You must add the-r option to compress the files in the second-level directory. # Zip-r test.zip test /*            

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.