Search rotated and compressed logs too
search old gz logs | grep compressed log files | grep in rotated logs | search last week's logs | zgrep | logrotate | gzip | searchzgrep -h "Out of memory" /var/log/syslog*zgrep works like grep but automatically decompresses .gz files and reads normal files as they are. The * at the end covers the current file, .1 and all .gz archives. -h omits the file name before each matching line; without that option you can see which rotation a match comes from.
Note: The files are processed in alphabetical order, not chronologically. Sort the output afterwards if you need a time-based order.
Also searched as
- search old gz logs
- grep compressed log files
- grep in rotated logs
- search last week's logs