sed - print lines between two matches in a file

From thelinuxwiki
Revision as of 02:23, 11 May 2013 by Nighthawk (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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