$ cat test 1 start 2 end 3 $ sed -n '1,/start/p;/end/,$p' test 1 start end 3 $ sed '/start/,/end/d' test 1 3