zless
file_compressionlinux
The zless command is one of the most frequently used commands in Linux/Unix-like operating systems. zless View compressed files with the less pager
Quick Reference
Command Name:
zless
Category:
file_compression
Platform:
linux
Basic Usage:
zless [options] [arguments]
Common Use Cases
Syntax
zless [options] file...
Options
## Common Options
zless accepts all options supported by the less command:
| Option | Description |
|--------|-------------|
| -e, --quit-at-eof | Exit when reaching end of file |
| -E, --QUIT-AT-EOF | Exit when reaching second end of file |
| -F, --quit-if-one-screen | Exit if entire file fits on first screen |
| -i, --ignore-case | Ignore case in searches |
| -I, --IGNORE-CASE | Ignore case in searches and patterns |
| -m, --long-prompt | Show more verbose prompt |
| -M, --LONG-PROMPT | Show even more verbose prompt |
| -n, --line-numbers | Don't display line numbers |
| -N, --LINE-NUMBERS | Display line numbers |
| -p, --pattern=pattern | Start at pattern (from command line) |
| -P, --prompt=prompt | Define new prompt |
| -q, --quiet | Quiet mode (no bell) |
| -Q, --QUIET | Even quieter mode |
| -r, --raw-control-chars | Display raw control characters |
| -s, --squeeze-blank-lines | Squeeze multiple blank lines into one |
| -S, --chop-long-lines | Chop long lines rather than wrapping |
| -x, --tabs=n | Set tab stops |
| -X, --no-init | Don't use termcap init/deinit strings |
| --no-keypad | Don't use termcap keypad init/deinit strings |
For a complete list of options, see the less(1) manual page.
Examples
How to Use These Examples
The examples below show common ways to use the zless
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
# Basic Examples Basic
# View a compressed file with zless
zless logfile.gz