I used grep for 2 years and did not even know …

Grep can show lines before and after found text line

grep -B 2 -A 5 ‘error\] \[php\]’ application.log
  • -B 2 = 2 lines before
  • -A 5 = 5 lines before
  • or use -C 4 = 4 lines before and 4 after
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.