I wrote the following awk to print lines from the match line until EOF
awk '/match_line/,/*/' file
How can I do the same in sed?
sed -n '/matched/,$p' file
awk '/matched/,0' file
This is for a really old version of GNU sed on Windows
GNU sed version 2.05
http://www.gnu.org/software/sed/manual/sed.html
-n only display if Printed
-e expression to evaluate
d stands for Delete
p stands for Print
$ end of file
line1,line2 is the range
! is NOT
abc
def
ghi
needle
want 1
want 2
Print matching line and following lines to end of file
>sed.exe -n -e "/needle/,$p" haystack.txt
needle
want 1
want 2
Print start of file up to BUT NOT including matching line
>sed.exe -n -e "/needle/,$!p" haystack.txt
abc
def
ghi
Print start of file up to AND including matching line
>sed.exe -n -e "1,/needle/p" haystack.txt
abc
def
ghi
needle
Print everything after matching line
>sed.exe -n -e "1,/needle/!p" haystack.txt
want 1
want 2
Print everything between two matches - inclusive
>sed.exe -n -e "/def/,/want 1/p" haystack.txt
def
ghi
needle
want 1
Delete everything between two matches, no -n with this usage
>sed.exe -e "/ghi/,/want 1/d" haystack.txt
abc
def
want 2