1、zip
Compression: zip filename.zip dirname
decompression: unzip FileName.zip
2 、 tar
Packing: tar cvf FileName.tar DirName
Unpacking: tar xvf FileName.tar
3、gz
Compression: gzip FileName
decompression: gzip -d FileName.gz
gunzip FileName.gz
4 、 tar.gz 和 .tgz
Compression: tar zcvf FileName.tar.gz DirName
decompression: tar zxvf FileName.tar.gz
5 、 .bz2
Compression: bzip2 -z FileName
Decompression: bzip2 -d FileName.bz2
bunzip2 FileName.bz2
6 tar .tar.bz2
Compression: tar jcvf FileName.tar.bz2 DirName
decompression: tar jxvf FileName.tar.bz2
7、.rar
Compress: rar a FileName.rar DirName
decompress: rar x FileName.rar
The gzip command
has two obvious advantages in reducing file size. One is that it can reduce storage space, and the other is that it can reduce the transfer time when transferring files over the network. gzip is a command often used in Linux systems to compress and decompress files, which is convenient and easy to use.