compress
Quick Reference
Command Name:
compress
Category:
file compression
Platform:
Linux/Unix
Basic Usage:
Common Use Cases
Syntax
compress [-cfvd] [-b bits] [file ...]
Options
Option | Description |
---|---|
-c |
Write to standard output; don't change input files |
-d |
Decompress input instead of compressing it |
-f |
Force compression even if it doesn't save space or the output file already exists |
-v |
Verbose mode; display compression ratio |
-b bits |
Set maximum code size (9 to 16, default is 16) |
Examples
How to Use These Examples
The examples below show common ways to use the compress
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
Basic Examples:
# Compress a single file (creates file.Z and removes original) compress file.txt
Advanced Examples:
# Compress with verbose output showing compression ratio compress -v largefile.txt