Replace text between two lines SED

From Michael's Information Zone
Revision as of 13:35, 21 July 2017 by Michael.mast (talk | contribs) (Created page with "<ref>https://nixtricks.wordpress.com/2013/01/09/sed-delete-the-lines-lying-in-between-two-patterns/</ref> *Remove the lines between the patterns. <pre> sed '/PATTERN-1/,/PATTE...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

[1]

  • Remove the lines between the patterns.
sed '/PATTERN-1/,/PATTERN-2/{//!d}' input.txt