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