Skip to content

Commit c325490

Browse files
committed
Grep Tutorial Snippets
1 parent 39d50f3 commit c325490

File tree

5 files changed

+561
-0
lines changed

5 files changed

+561
-0
lines changed

Terminal/Grep/Personel/emails.txt

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
Corey Schafer
3+
4+
5+
John Williams
6+
7+
8+
Jane Doe
9+
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
Corey Schafer
3+
304-555-0223
4+
5+
John Williams
6+
321-555-1234
7+
8+
Jane Doe
9+
123-555-4321

Terminal/Grep/grep-commands.txt

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
grep "Jane Williams" names.txt
2+
grep "John Williams" names.txt
3+
4+
grep -w "John Williams" names.txt
5+
grep -wi "John Williams" names.txt
6+
grep -win "John Williams" names.txt
7+
8+
grep -win -B 4 "John Williams" names.txt
9+
grep -win -A 4 "John Williams" names.txt
10+
grep -win -C 2 "John Williams" names.txt
11+
12+
grep -win "John Williams" ./*
13+
grep -win "John Williams" ./*.txt
14+
grep -winr "John Williams" .
15+
grep -wirl "John Williams" .
16+
grep -wirc "John Williams" .
17+
18+
history
19+
history | grep "git commit"
20+
history | grep "git commit" | grep "dotfile"
21+
22+
grep "...-...-...." names.txt
23+
grep -P "\d{3}-\d{3}-\d{4}" names.txt
24+
grep -V

Terminal/Grep/memo.txt

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
Dear Mr. Doe,
3+
4+
In our meeting today, John Williams had mentioned that the work could be completed by the end of the month.
5+
6+
We really appreciate the hard work!
7+
8+
Thanks,
9+
Corey Schafer

0 commit comments

Comments
 (0)