Search for a pattern within multiple files

egrep

  • Find patterns in files using extended regular expression (supports `?`, `+`, `{}`, `()` and `|`).
    More information: <https://manned.org/egrep>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

egrep "{{search_pattern}}" {{path/to/file1}} {{path/to/file2}} {{path/to/file3}}

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