Copied to clipboard


gzip is a command-line compression tool on Linux, which can compress files and store them as gzip format files. Using gzip command can greatly reduce the size of files, save disk space, and speed up file transfer.


  • Compress a file:

    gzip <file>

  • Compress a directory and all its files:

    gzip -r <dir>

  • Decompress a file:

    gzip -d <file.gz>

  • Write compressed data to standard output:

    gzip -c <file>

  • List the information of compressed files:

    gzip -l <file.gz>