Mode: pattern
Regular:
grep: Basic Regular
Extended grep: Extending the regular
Basic Regular:
. : Any single character
[]: Within the specified range
[^]: outside the specified range
Number of Matches
*: Characters appear any time
?: Characters appear 0 or 1 times
\{m,n\}: Characters appear at least m times, at most n times
\{1,\}: Characters appear at least 1 times
. *: Matches any character of any length
Anchoring:
^: Anchoring the beginning of the line
$: Anchor Line End
\< or \b: anchoring the word head
\> or \b: Anchor word endings
\(\)
\ (\1): Refers to the contents of a 1th parenthesis
Grep
-I: Ignore case
-V: Reverse Lookup
-O: Show Only strings
--colour: Displays the color
-e: Extended Regular, Egrep
-after 10: Show matching pattern lines, and 10 rows later
-before 10: Display the matching pattern line, and the previous 10 rows
-context 10: Display matching pattern lines, and 10 rows before and after faces
Extended Regular: Egrep
Character Matching:
. : Matches any character
\. Match.
[]
[^]
Number of Matches
*: Any time before the character
? : Its front character 0 or 1 times
+: Match its preceding character at least 1 times
Grep-e ' ^[[:space:]]+ '/boot/grub/grub.conf: At least 1 whitespace characters
{M,n}: characters at least m times, up to N times
Location anchoring:
^
$
\<
\>
Group:
(),
\1
Or
A|b:a or B
C|cat:c or Cat
Egrep and extended regular