how can I remove number of line based on regex search? for example : if i have a file :
aaa
bbb
ccc
ddd
bbb
eee
I would like to remove the line that contains "bbb" string and the line after it . so the result should look like :
aaa
ddd
addr1,+N Will match addr1 and the N lines following addr1.
$ sed '/bbb/,+1d' file.txt
aaa
ddd
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With