Skip to content

Instantly share code, notes, and snippets.

@remeika
Last active August 29, 2015 14:24
Show Gist options
  • Save remeika/dbc0a669216588715ef0 to your computer and use it in GitHub Desktop.
Save remeika/dbc0a669216588715ef0 to your computer and use it in GitHub Desktop.
Grep through all log files, compressed and otherwise.
# Let's say you've got some log files that look like this:
# my.log
# my.log.1
# my.log.2.gz
# my.log.3.gz
# To seach for text across all log files, just do this:
find . -name "my.log*" -exec zcat "{}" + | grep 'log line text'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment