Skip to main content


The whole docs section is work in progress. Feedback is highly welcome.

Off. documentation:
tested Version:
Grep 3.4



grep [option...] [patterns] [file...]

My most used Options:

Recursivly search directory
Reverse search
Displays only the count of matching lines
Shows the matching line and its number
Match both upper and lower case
Process a binary file as if it did not contain matching data
Shows just the name of the file with the string
Shows only exact matches
Show addtional lines above and below matching line:
-A 1 - Show x lines above
-B 1 - Show x lines below
-C 1 - Show x lines above and below


"/' around patterns are often enough not required

Only show result of pattern is at the start of the line:
Only show result if pattern is at the end of the line:
Look for special characters like -:
grep '\-c'
(\ is the escape character)
grep -- '-c'
(-- flag to stop switch parsing)
Search multiple patterns
Grep OR:
grep -E "pineapple|pizza" file.txt
grep -e pineapple -e pizza file.txt
grep 'pineapple\|pizza' file.txt
Grep AND:
grep 'pizza' file.text | grep 'pineapple'
grep -E 'pizza.*pineapple' file.text (In order)
grep -E 'pizza.*pineapple|pineaple.*pizza' file.text



Coming soon: logs, manuals, tests

Helpful links


Add examples for flags
Examples with regex
Link to grep blog posts
Link to the source for comments/ changes
Go through bookmarks and add helpful links

You can contact me via ...