File compression utility using the DEFLATE algorithm for reducing file sizes with optional decompression and stream processing.
gzip {stdout} {decompress} {force} {help} {keep} ๐ stdout ๐ decompress ๐ force ๐ help ๐ keep gzip {stdout} {decompress} {force} {help} {keep} Sandbox: execFile · Timeout: 300s
filesystem.compress.gzip filesystem.decompress.gzip filesystem.compress.stream filesystem.archive.compress | Name | Type | Required | Default | Description | Aliases |
|---|---|---|---|---|---|
stdout | string | No | - | write on standard output, keep original files unchanged | -c, --stdout |
decompress | string | No | - | Set the decompress parameter | -d, --decompress |
force | file | No | - | force overwrite of output file and compress links | -f, --force |
help | string | No | - | give this help | -h, --help |
keep | file | No | - | keep (don't delete) input files | -k, --keep |
list | string | No | - | list compressed file contents | -l, --list |
license | string | No | - | display software license | -L, --license |
no-name | string | No | - | do not save or restore the original name and timestamp | -n, --no-name |
name | string | No | - | save or restore the original name and timestamp | -N, --name |
quiet | string | No | - | suppress all warnings | -q, --quiet |
recursive | string | No | - | operate recursively on directories | -r, --recursive |
rsyncable | string | No | - | make rsync-friendly archive | --rsyncable |
suffix | string | No | - | --synchronous synchronous output (safer if system crashes, but slower) | -S, --suffix |
test | string | No | - | test compressed file integrity | -t, --test |
verbose | string | No | - | verbose mode | -v, --verbose |
version | string | No | - | display version number | -V, --version |
fast | string | No | - | compress faster | -1, --fast |
best | string | No | - | compress better | -9, --best |
synchronous | boolean | No | - | synchronous output (safer if system crashes, but slower) | --synchronous |
| Type | Description | MIME | Schema | Trust |
|---|---|---|---|---|
filesystem.archive.gzip | Gzip-compressed file | application/gzip | 1.0.0 | verified |
filesystem.file.raw | Decompressed file content | - | - | verified |
Inputs
filesystem.file.raw File to compress
filesystem.archive.gzip Gzip archive to decompress
Outputs
filesystem.archive.gzip Compressed gzip archive
filesystem.file.raw Decompressed file content
filesystem_write Produces
filesystem.archive.gzipfilesystem.file.rawConsumes
filesystem.file.rawfilesystem.archive.gzip| Resource | Value |
|---|---|
| CPU | high |
| Memory | 32 MB |
| Network | none |
| Disk I/O | high |
Compress a file
gzip file.txt Decompress a .gz file
gunzip file.txt.gz Compress with maximum compression
gzip -9 largefile.tar Keep original file when compressing
gzip -k file.txt Stream compression in a pipeline
cat largefile | gzip -c > output.gz View compressed file contents
zcat file.txt.gz Gzip (GNU zip) is a widely used compression utility based on the DEFLATE algorithm. It provides a good balance of compression ratio and speed, making it the standard for text compression on Unix systems.
| Level | Flag | Speed | Size Reduction | Use Case |
|---|---|---|---|---|
| 1 | --fast |
Fastest | Lowest | Quick compression, already-compressed data |
| 6 | (default) | Good | Good | General purpose |
| 9 | --best |
Slowest | Highest | Archival, distribution |
# Compress a tar archive
tar cf - directory/ | gzip -c > archive.tar.gz
# Decompress and extract
gunzip -c archive.tar.gz | tar xf -
# Search compressed files without decompressing to disk
zcat access.log.gz | grep 'ERROR'
# Count lines in compressed file
zcat data.txt.gz | wc -l
# Stream compression over pipe
mysqldump database | gzip -c > backup.sql.gz
| File Type | Typical Ratio | Notes |
|---|---|---|
| Text/Code | 60-80% | Highly compressible |
| Logs | 70-90% | Very high compression |
| JSON/XML | 70-85% | Repeated patterns compress well |
| Images (PNG) | 0-5% | Already compressed |
| Archives | 0-10% | Usually already compressed |