commands
bzip2 — compress bzip2 streams
Compresses or decompresses bzip2 streams; -c writes stdout and leaves the input intact, -d decodes, -t checks integrity. Default file mode may replace input. Example assumes a fresh archive lab fixture with new output names.
Formal Syntax & Structure
linux syntaxlinux
bzip2 [-c|-d|-t] [FILE...]Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| -c | option | stdout |
| -d | option | decode |
| -t | option | test |
| FILE | operand | input |
Return Value
exit status and output
Compresses or decompresses bzip2 streams; -c writes stdout and leaves the input intact, -d decodes, -t checks integrity. Default file mode may replace input.
Working Example
Example Snippetlinux
bzip2 -c notes.txt > notes.bz2bzip2 -t notes.bz2 && bzip2 -dc notes.bz2