Show Menu
Cheatography

grep Cheat Sheet (DRAFT) by

Cheat sheet for grep function

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Matching

-e
\n separated patterns
-f
file with patterns (1 per line)
-i
ignore case
-v
invert match
-w
word regex
-x
line regex

grep programs

-G
basic
-E
extended
-F
fixed string
-P
Pearl

Output control

-c
print num of matches per file
-L
print only names of files with NO matchimng lines
-l
print only files with matching lines
-m
stop scanning a file after m matches found
-o
print only what was actually matched