How do I compress old logs but still grep them without decompressing?
Try: zgrep 'ERROR' /var/log/app-2026-06.log.gz Info: zgrep, zcat, and zless inspect .gz files in memory without extracting them to disk. Examples: $ zcat access.log.gz | awk '{print $1}' | sort -u $ zless huge-log.log.gz # Page through compressed file $ find /var/log -name '*.log' -mtime +7 -exec gzip {} \; Note: z-tools […]
Read More