Grep Line After Match

[Solved] Grep Line After Match | Perl - Code Explorer | yomemimo.com
Question : grep show lines above and below

Answered by : important-iguana-rxht8hjyf2vv

grep -C 3 foo README.txt

Source : https://stackoverflow.com/questions/9081/grep-a-file-but-show-several-surrounding-lines | Last Update : Sun, 05 Jul 20

Question : grep lines after match

Answered by : paulo-yjl1tqmpvrf6

$ grep -A1 text
-AX tells grep to display 'X' amount of lines after line of match.
Use -BX to do the same but before.

Source : | Last Update : Wed, 06 Oct 21

Question : grep line after match

Answered by : armando-flores

Include -A flag to add lines after match and -B flag to add lines before
grep match -A 3	#display match line and 3 after lines
grep match -B 2 #display match line and 2 lines before

Source : | Last Update : Thu, 03 Dec 20

Question : grep show lines after match until other match

Answered by : ian-morales

{"tags":[{"tag":"p","content":"grep all lines until match<br>"},{"tag":"textarea","content":"#Don\u00b4t use grep, use sed:\nsed -n -e '\/Word A\/,\/Word D\/ p' file\n\n#To iterate in different files (Don\u00b4t use for loop):\nsed -n -e '\/Word A\/,\/Word D\/ p' file*","code_language":"shell"}]}

Source : | Last Update : Thu, 02 Nov 23

Answers related to grep line after match

Code Explorer Popular Question For Perl