Skip to content
evanmoran edited this page Dec 14, 2012 · 4 revisions

Important Options

-r           Recursive
-i           Case insensitive
-v           Invert match by showing lines that do not match
-C <int>     Show <int> number of lines before and after match

Search for regexp in every file in current directory

grep 'regexp' *

Search for regexp recursively and show three lines before and after

grep -r -C 3 'regexp' *

Related

  • quick ack - better search through source code
Clone this wiki locally