Search for lines that do not match a pattern

zegrep

  • Find extended regular expression patterns in compressed files using `egrep`.
    More information: <https://www.unix.com/man-page/freebsd/1/zegrep/>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

zegrep --invert-match "{{search_pattern}}" {{path/to/file}}

click the source code to copy install zegrep on any operating system with command-not-found.com