Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d542134

Browse files
before and after search results in grep
1 parent c86d24f commit d542134

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

‎README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,14 @@ dep%: subdep1 subdep2
339339
### grep
340340

341341
```bash
342-
# find pattern in files
343-
grep --include=\*.{py, c, h} --exclude=\*.o --exclude-dir={dir1,dir2,*.dst} -rnw '/path/to/somewhere/' -e "pattern"
342+
# find pattern in files and include NUM lines after and before search result
343+
grep --include=\*.{py, c, h} \
344+
--exclude=\*.o \
345+
--exclude-dir={dir1,dir2,*.dst} \
346+
-rnw '/path/to/somewhere/' \
347+
-e "pattern" \
348+
--after-context=NUM \
349+
--before-context=NUM
344350
```
345351
More `grep` funda [here](https://www.grymoire.com/Unix/Grep.html)
346352

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /