RedhatLinux tar, gzip, zip, and other compression commands

Source: Internet
Author: User
[Gzip/gunzip] gzip is the compression command, and the corresponding gunzip is the decompression command, which is very simple to use, as follows: gzipfile1 is compressed, the compressed file name is file1.gzgunzipfile1.gz, and the decompressed file name is file1. note: gzip/gunzip will delete the source file...
[Gzip/gunzip] gzip is the compression command, and the corresponding gunzip is the decompression command, which is very simple to use, as follows: gzip file1 is compressed, the compressed file name is file1.gz gunzip file1.gz, and the decompressed file name is file1. note: gzip/gunzip will delete the source file, and it can only process files but cannot process directories. Www.2cto.com [tar] is a commonly used packaging command in Linux/Unix systems. common parameters are as follows:-c: Create a packaging file-x: Release the packaging file-t: list the content of the packaged file-v: list the processed files. the detailed information of the file is displayed when-TV is executed simultaneously, similar to the result of ls-l-f: specify the target file-z: execute-c or-x and execute the gzip or gunzip command tar to process the directory without deleting the source file. for example: tar-cvf/home/jack/dest.tar/home/jack/source package/home/jack/source into/home/jack/dest.tar-zcvf/home/jack/dest.tar.gz/ home/jack/source package/home/jack/source and compress it into/home/jack/dest.tar.gz tar-tvf/home/jack/dest.tar to view the content in/home/jack/dest.tar.
The above process is tar-xvf/home/jack/dest.tar-zxvf/home/jack/dest.tar.gz www.2cto.com [zip/unzip] by default, the only common compression format for windows and linux is zip. Therefore, if you need to transfer files in windows and linux systems, compress them into zip format. Zip will not delete the source file, but can also compress the directory, for example: zip file.zip file: file.zip zip-r folder.zip/home/jack/myf compressed myfdirectory: folder.zip unzip-r/home/jack/myf2 folder unzip [bzip2] bzip2 is similar to the gzip command, however, the compression ratio is very high when files are compressed, but files can only be processed. In addition, you can use the-k parameter to specify not to delete the source file, for example, bzip2 test. after the log is compressed, the file test.log.bz2 bzip2-d test.log.bz2 is decompressed, and-d indicates decompression.
Related Article

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.