read the transcript!
grep lets you files for text search
$ grep bananas foo.txt
Here are some of my favourite grep command line arguments!
panel 2: -E
Use if you want regexps like “.+” to work. otherwise you need to use “.+“
panel 3: -v
invert match find : all lines that don’t match
panel 4: -r
recursive! Search all the files in a directory.
panel 5: -o
only print the matching part of the line (not the whole line)
panel 6: -i
-A -B -C
Show context for your search
$grep -A 3 foo
will show 3 lines of context after a match
panel 8: -l
only show the filenames of the files that matched
panel 9: -F aka fgrep
don’t treat the match string as a regex
$ grep -F...
panel 10: -a
search binaries: treat binary data like it’s text instead of ignoring it!
panel 11: grep alternatives
ack ag ripgrep
(better for searching code!)