Home Linux Utils
grep for more than one string at a time

egrep "arg1|arg2|arg3" 


grep for the occurance of two words on one line ( follow order ) 

egrep "word1.*word2" 


grep for ip addresses 

grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b"


removing egrep from egrep

egrep "[w]ord" 

[] has no effect on the meaning of the expression  but the command grep won't match anymore because they are stripped as it executes.

grep for word only

grep -P '\b<word>\b'


\b matches word boundaries