Table of Contents

grep

http://www.gnu.org/software/grep/

Command line usage

grep [options] PATTERN [FILE...]
grep [options] [-e PATTERN | -f FILE] [FILE...]

Examples

printenv <html></html> grep libprint a list of environment variables that contain “lib”
grep -e foo -R -n . search from current directory and below, inside of files for “foo”, and print a list of file paths, line numbers, and lines that match
grep -e foo -R -l . search from current directory and below, inside of files for “foo”, and only print a list of files that match
grep -i foo -R -l . same as previous, but case insensitive “foo” (foo, Foo, FOO, etc…)

Complex Examples