gzip

Linux · Files · available in the simulator

What it does

Compress a file to .gz (replaces the original unless -k is specified).

Syntax

gzip [opciones] archivo...

Options and parameters

  • -d

    Decompress the file; equivalent to gunzip.

    gzip -d archivo.gz
  • -k

    Keep the original file.

  • -l

    Display compression information for the file.

  • -t

    Test integrity of the compressed file.

  • -v

    Verbose mode.

  • -r

    Recursively compress files in directories.

  • -9

    Maximum compression, slower; -1 is fastest.

    gzip -9 archivo.log
  • -c

    Write output to standard output.

Usage examples

  • gzip fichero
  • gzip -tv fichero.gz
  • gzip -lv fichero.gz
  • gzip -k fichero
  • gzip -d fichero.gz
  • gzip archivo.log
  • gzip -dk archivo.gz
  • gzip -d archivo.gz
  • gzip -9 archivo.log
Practise gzip

Related commands