VideosMy ProjectsProgramming BlogGallery
  1. Home
  2. Blog
  3. Get additional lines before and after grep match
Programming Blog

Atom/RSS Feed

linux

Get additional lines before and after grep match

linux

To get additional lines before and after the grep match you can add the arg -n

<cmd> | grep <criteria> -n#

For Example

<some command> | grep "criteria" -n5
Join my mailing list