$
grep -rn 'ERROR' /var/log/
/var/log/syslog:4821: kernel: ERROR unable to enumerate USB device
/var/log/auth.log:1203: pam_unix: ERROR conversation failed
Recursive search with line numbers — great for log triage
$
grep -v '^#' /etc/ssh/sshd_config
Port 22
PermitRootLogin no
PasswordAuthentication yes
PubkeyAuthentication yes
Strip comments — shows only active config lines
$
grep -c 'Failed password' /var/log/auth.log
347
Count brute-force attempts without reading every line