grep

Search text files for lines matching regular expressions

brewmacoslinux
Try with needOr install directly
Source

About

GNU grep, egrep and fgrep

Commands

grepegrepfgrep

Examples

Search for a pattern in a file$ grep 'pattern' filename.txt
Search recursively in directories with line numbers$ grep -rn 'search_term' /path/to/directory
Use extended regex to find lines matching complex patterns$ egrep '^[0-9]{3}-[0-9]{4}$' phonelist.txt