Skip to main content

grep

Case-insensitive grep a file for a word/term

grep -i "some term" somefile.txt

Grep if there are binary matches found

cat somefile.txt | grep -i match --text

Match whole words in a file

grep -w 'hi' somebigfile.txt

Search for word in file but still display rest of the file and only highlight matches

grep -i "REMOVE\|" log

Source: Twitter