Common grep options and commands
-E matches according to Extended specification
-- color tag matching color
-I ignore case matching
[fbl@www test6_26] $echo "hello" | grep-I-- color 'HELLO'hello
-Q quiet match means no output
[fbl@www test6_26] $echo "hello" | grep-Q-- color 'hello' [fbl@www test6_26] $echo $? 0
-o output only the parts that match
[fbl@www test6_26] $echo "hello" | grep-E-o-- color 'hell*'hell
-w displays only the lie that matches the whole word
[fbl@www test6_26] $cat file1hellohelloohell [fbl@www test6_26] $cat file1 | grep-E-- color 'hell'hellohelloohell [fbl@www test6_26] $cat file1 | grep-wE-- color' hell'hell
[fbl@www test6_26] $cat file
Apple
Bahyude
Nue
111123
88888
Hello
Change
Brance
6666
[fbl@www test6_26] $cat file | grep-E-- color'^ [a Murz] {1,} [a Murz] $'applebahyudenuehellochangebrance
-c the number of columns to which the output matches
[fbl@www test6_26] $cat file | grep-cE-- color'^ [a Murz] {1,} [a Murz] $'6
-n displays the matching column and column number
[fbl@www test6_26] $cat file | grep-nE-- color'^ [a Murz] {1,} [a Murz] $'1:apple2:bahyude3:nue6:hello7:change8:brance
-v displays mismatched columns
[fbl@www test6_26] $cat file | grep-vE-- color'^ [a Murz] {1,} [a Murz] $'111123888886666
-an offset matching
[fbl@www test6_26] $cat file | grep-a2-- color 'hello'11112388888hellochangebrance