I want to grep a file (the output of lmstat -a) and see the matching line plus the next few.
The first part is easy; lmstat -a | grep -i xyz
but how can I get the next few lines? or maybe the subsequent lines up until the occurrence of a different pattern?
In regex this would be something like
lmstat -a | grep -ie 'users of xyz.*users'
but grep wont do singleline mode.
The first part is easy; lmstat -a | grep -i xyz
but how can I get the next few lines? or maybe the subsequent lines up until the occurrence of a different pattern?
In regex this would be something like
lmstat -a | grep -ie 'users of xyz.*users'
but grep wont do singleline mode.