Using grep & Regular Expressions
\
remove special meaning from the next character
grep linux files
search files for lines with the word linux
grep taxes *
searches for taxes
adding a hypen like so, [ - ] does what?
searches through a range
-i
case insensitive search
What is grep?
Use it to search for words or content within a file or files
-v
find all instances without a pattern match
-r
makes the search recursive through a directory structure
.
match a single character of any value, except end of line
-w
match a word rather than any pattern match
[^ ]
match any character except the enclosed ones
[ ]
match any enclosed characters
\{x\}
match exactly x occurrences of the preceding value
$
match expression at the end of a line
^
match expression at the start of the line
\{x, \}
match x or more occurrences of the preceding value
\{x,y\}
match x to y occurrences of the preceding value
*
match zero or more of the preceding character or expression