Skip to content

Commit 0d6be2b

Browse files
SanMuHeSanMuHe
SanMuHe
authored and
SanMuHe
committed
Add Grep Recursively as a Linux TIL
1 parent 179105d commit 0d6be2b

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ A collection of things I learn every day accross different techniques, programmi
88
- [Find Size of Directory](linux/find-directory-size.md)
99
- [Find Disk Usage](linux/find-disk-usage.md)
1010
- [Find File in Directory Recursively](linux/find-file-in-directory-recursively.md)
11+
- [Grep Recursively](linux/grep-recursively.md)
1112
- [List Directories in Tree-Like Format](linux/list-directories-in-tree-like-format.md)
1213
- [Vi Mode in Bash](linux/vi-mode-in-bash.md)
1314

linux/grep-recursively.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Grep Recursively
2+
3+
If you want to find a string in all directories and subdirectories, you can use
4+
5+
```
6+
grep -r pattern /path/to/start
7+
```
8+
9+
If you want to include or exclude particular file types during the search, you can use
10+
11+
```
12+
grep -r --include "*.txt" pattern /path/to/start
13+
grep -r --exclude "*.txt" pattern /path/to/start
14+
```

0 commit comments

Comments
 (0)