Compress a file while keeping the original.
gzip -k report.logCompress a file with gzip. By default, the input file is replaced by its compressed form.
gzip [OPTION]... [FILE]...Compress a file while keeping the original.
gzip -k report.logDecompress a gzip file and keep the compressed original.
gzip -dk report.log.gz| Option / clause | Description |
|---|---|
-d, --decompress | Decompress files. |
-k, --keep | Keep the input file instead of removing it. |
-c, --stdout | Write output to standard output and keep input files. |
-r, --recursive | Process files in directories recursively. |
-1 to -9 | Set compression speed/size trade-off; -1 is faster, -9 smaller. |
-v, --verbose | Show compression ratio and file names. |
Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.