$ cat ip.txt
address
range
substitution
pattern
sample
Add Sub Mul Div
Lines matching a pattern
$ sed '/add/d' ip.txt
range
substitution
pattern
sample
Add Sub Mul Div
$ sed -n '/t/p' ip.txt
substitution
pattern
$ sed -n '/[A-Z]/ s| |/|gp' ip.txt
Add/Sub/Mul/Div
Range of patterns
$ sed -n '/add/,/sub/p' ip.txt
address
range
substitution
$ sed -n '/a/,/e/p' ip.txt
address
range
pattern
sample
Note
1,2
and lines 4,5
/
for specifying the patternCase-insensitive match
$ sed -n '/add/Ip' ip.txt
address
Add Sub Mul Div
$ sed -n '/add/I,/sub/p' ip.txt
address
range
substitution
Add Sub Mul Div