Output Lines Between Two Matching Lines

This page answers questions like these:

Output the Lines Between Two Matching Lines (Inclusive)

sed -n '/PATTERN1/,/PATTERN2/p' FILE ...

Output the Lines Between Two Matching Lines (Exclusive)

sed -n '/PATTERN1/,/PATTERN2/{ /PATTERN1/b /PATTERN2/b p }' FILE ...
Related Links:
Count Occurrences of a Hexadecimal Sequence in a File
Count Occurrences of a String in a File
Find Positions of a Hexadecimal Sequence in a File
Join Lines of Text File Together
Output Lines of a File in Reverse Order

Home  >  Linux / Unix  >  Output Lines Between Two Matching Lines


Tags: pairs of lines, show lines between two matching patterns, cat in reverse order, linux, unix

Src: file-output-only-lines-between-two-matching-lines.txt
Dst: Linux-Unix/output-only-lines-between-two-matching-lines.htm
Ads: 3