May 2017
Beginner
552 pages
28h 47m
English
The grep command is the magic Unix utility for searching text. It accepts regular expressions and can produce reports in various formats.
$ echo -e "this is a word\nnext line" | grep word
this is a word
$ grep pattern filename
this is the line containing pattern
Alternatively, this performs the same search:
$ grep "pattern" filename
this is the line containing pattern
$ grep "match_text" file1 file2 file3 ...