The Linux Newbie Guide  ⇒    Fundamentals     Advanced     Supplement   Command Index   ENG⇒中
All rights reserved, please indicate the source when citing
  

Compressing and Decompressing gz Files with Gzip 



The gzip command (GNU zip) is specifically designed for compressing and decompressing "gz" files, typically identified by the ".gz" file extension. The syntax for the gzip command is gzip [OPTIONS] FILES.

Here are some commonly used options:

Example:
$ gzip * ←Compress all files in the current working directory
$ gzip -d *.gz ←Decompress all ".gz" files in the current working directory
$ gzip -9 *.cpp ←Compress all ".cpp" files with compression level 9


For more examples, explanations, please refer to the provided link.