Search for lines matching a pattern, printing only the matched text

bzgrep

bzgrep --only-matching "{{search_pattern}}" {{path/to/file}}

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