Archives et compressionCLI Manual
$gzip
Compress or expand files using Lempel-Ziv coding (LZ77).
Syntaxe de la commandePOSIX Standard
gzip [OPTIONS] [FILE...]Essayer en direct dans le bac à sable interactif
Simulation côté client sans installation avec retour instantané.
bash — terminal
AST Sandbox (Free)
Aperçu et fonctionnement
`gzip` compresses individual files, replacing them with `.gz` extensions. It is the standard compression format across Linux for package distribution, web compression, and system log archiving.
Options et drapeaux courants
| Flag / Option | Description |
|---|---|
| -d, --decompress | Decompress files (same as gunzip). |
| -k, --keep | Keep (do not delete) original input files during compression. |
| -9, --best | Use maximum compression ratio (slower). |
Exemples pratiques du monde réel
#1Compress a log file
gzip -k notes.txt && ls -l notes.txt*Compresses notes.txt to notes.txt.gz while preserving original notes.txt.