Operators grep live logs with grep but rotated files end in .gz — zless and zcat avoid decompressing to /tmp. Works alongside smartctl job logs.
Page through gzip
zless behaves like less on compressed files.
bashzless
zless /var/log/syslog.2.gz

Dump to stdout
zcat for scripts and pipes.
bashzcat
zcat /var/log/nginx/access.log.1.gz | head

Search compressed
zgrep for ERROR across rotations.
bashzgrep
zgrep -h 'POST /api' /var/log/nginx/access.log*.gz | tail

Avoid full gunzip
Only gunzip when you must edit the file in place.
TipOn low-disk VPS, never
gunzip multi-GB logs — stream with zcat into files you delete after.
Quick Reference
- Read:
zless file.gz - Pipe:
zcat file.gz | grep - Search:
zgrep pattern file.gz
Related tutorials
Diagrams are original illustrations by Gnome IT Solutions. Tutorial text © Gnome IT Solutions.