Linux Redhat Red Hat CentOS compression decompression

Source: Internet
Author: User
Tags bz2 gz file

1. zip file as GZ format: gzip file name; command path:/bin/gzip; only files can be compressed, directories cannot be compressed, and the original files are not preserved after compression.

2. Unzip the GZ file: gunzip file name; command path:/bin/gunzip; The original file is not retained after decompression.


3, Packaging directory for. tar.gz format: tar [option-ZCF] [file name after compression] [directory]; Note:-C package;-V to show details;-F to specify the file name;-Z package to compress;

4. Unzip the. tar.gz file: TAR-ZXVF file name; Note:-X unpack,-V to show details;-F to specify extract file;-Z to extract; command path:/bin/tar.


5, compressed to zip file format: Zip option "-r" "Compressed file name" "Files or directories";-r compression directory, zip compression is retained the original file or the original directory; command path:/usr/bin/zip.

6. Unzip the. zip file: Unzip ". zip compressed file name"; command path:/usr/bin/unzip; After decompression, the original file is retained.


7. Compress the file into. bz2 format: bzip2 option "-K" "File"; Note:-K retains the original file after the compressed file is generated; command path:/USR/BIN/BZIP2;

8. Extract the. bz2 file: Bunzip2 option "-K" "Compressed file"; K to extract the files after the original file, no parameter K, after decompression does not retain the original file; command path:/USR/BIN/BUNZIP2;


Linux Redhat Red Hat CentOS compression 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.