Question : grep all lines until match
Answered by : important-iguana-i9wyn2hbpk1m
sed -n -e '/Word A/,/Word D/ p' file
Source : https://unix.stackexchange.com/questions/21076/how-to-show-lines-after-each-grep-match-until-other-specific-match | Last Update : Mon, 19 Sep 22
Question : grep two lines
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 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