Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save aakbar5/51c76fe7a1a427dddff70c2115b20e93 to your computer and use it in GitHub Desktop.

Select an option

Save aakbar5/51c76fe7a1a427dddff70c2115b20e93 to your computer and use it in GitHub Desktop.
Filter lines starting with a specific keyword
grep -Ev '^(X|Y|Z)' /path/to/your/file
-E is to use extended regular expressions.
^ matches the beginning of the line.
(X|Y|Z) means lines start with X or Y or Z.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment