Output Lines Between Two Matching Lines

This page answers questions like these:


Related Links:
Delete Lines Between Two Matching Lines
Output Lines of a File in Reverse Order
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 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:
Delete Lines Between Two Matching Lines
Output Lines of a File in Reverse Order
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

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


Tags: show lines between two matching patterns, show lines between two matching lines, linux, unix, solaris, bsd, aix

Copyright © HelpDoco.com
file-output-only-lines-between-two-matching-lines.txt
Linux-Unix/output-only-lines-between-two-matching-lines.htm
2