Skip to content

Instantly share code, notes, and snippets.

@barseghyanartur
Created January 22, 2020 12:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barseghyanartur/2cec809cd1a091411b06e6af7427b823 to your computer and use it in GitHub Desktop.
Save barseghyanartur/2cec809cd1a091411b06e6af7427b823 to your computer and use it in GitHub Desktop.
Handy grep

Prints out in which files the match ("Exception") was found:

grep -r -l Exception /var/log/all.log.*

Print 30 lines surrounding match ("Exception):

cat /var/log/all.log.20 | grep -C 30 "Exception"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment