The gzip command
compress or expand files 4 examples from the lessons of the IVski Linux Playground — try them in the terminal next to them.
Options in the examples
-d --decompress --uncompress- Decompress.
-k --keep- Keep (don't delete) input files during compression or decompression.
Examples
gzip file.txtCreates file.txt.gz, removes original
gzip -k file.txtKeep original
gzip -d file.txt.gzSame as gunzip
sudo gzip largefile.logCompress instead of deleting, if unsure