Rapid fire: one-liners for logs and text.
BeginnerConceptBest practices and rapid-fire commands
Answer
journalctl -u nginx --since '1 hour ago' -p err --no-pager
tail -F /var/log/app/app.log | grep --line-buffered ERROR
grep -c ' 500 ' access.log
awk '{print $9}' access.log | sort | uniq -c | sort -rn
sed -n '100,120p' app.log
grep -rIl 'TODO' --exclude-dir=.git .
awk 'length > 500' app.log | head # suspiciously long lines
zcat app.log.*.gz | grep -F 'timeout' | wc -l
--line-buffered makes grep flush each line, so piping tail -F into it works in real time.
More on Best practices and rapid-fire commands
What does a production-ready script template look like?AdvancedWhat logging practices do you follow in automation scripts?IntermediateHow do you make a script support a dry-run mode cleanly?BeginnerRapid fire: one-liners for disk, memory and process checks.BeginnerRapid fire: one-liners for files and housekeeping.BeginnerRapid fire: one-liners for JSON, YAML and cloud CLIs.Beginner