2.GrepRegEx
2.GrepRegEx
System
Administrator
Or as part of a pipe:
find . –name *.txt | grep taxes
Course Title
grep Common Flags
grep
-i: Makes the search case
insensitive
Course Title
grep Regular Expressions Pt. 1
^ Match expression at the start
of a line, as in ^A
Course Title
grep Regular Expressions Pt. 2
Course Title
grep Regular Expressions
Search files for lines with the word
linux:
grep linux files
With linux at the start of a line:
grep '^linux' files
With linux at the end of a line:
grep 'linux$' files
Show lines containing only linux:
grep '^linux$' files
Lines starting with '^s', \ escapes the ^:
grep '\^s' files
Search for either Linux or linux:
grep '[Ll]inux' files
Search for BOB, Bob, BOb or BoB:
grep 'B[oO][bB]' files
Search for blank lines:
grep '^$' files
Search for pairs of numeric digits:
grep '[0-9][0-9]' file
Course Title