sed - print lines between two matches in a file

From thelinuxwiki
Jump to: navigation, search


sed -n -e '/Word B/,/Word D/ p' file

file:

Word A
Word B
Word C
Word D
Word E
Word F

output:

Word B
Word C
Word D