Bash sed

From I Will Fear No Evil
Revision as of 15:01, 14 June 2022 by Chubbard (talk | contribs)
Jump to navigation Jump to search

Useful sed commands

cat foo | sed "1,/^stringMatch/d"

  • Will ignore all before string match until EOF
  • stringMatch must be start of line (^)

cat foo | sed "/^stringMatch2/q" | grep -v "^stringMatch2"

  • will match ALL until match ( and remove match string LINE)