How do you grep more lines?

Như Quỳnh

New member
How do you grep more lines?
Answer
To also show you the lines before your matches, you
can add -B to your grep. The -B 4 tells grep to also show the 4 lines before the match. Alternatively, to show the log lines that match after the keyword, use the -A parameter. In this example, it will tell grep to also show the 2 lines after the match.
 

Tìm kiếm

Back
Top