Before and After

/ Published in: Bash
Save to your folder(s)

"-b" and "-a" tells grep to show you 10 lines before and 10 lines after

Copy this code and paste it in your HTML
  1. cat some_log_file | grep -b 10 -a 10 "something to search for"

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.