-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add grep.md #1223
Add grep.md #1223
Conversation
5fcc007
to
2507080
Compare
### Usage | ||
{: .-prime} | ||
|
||
```bash |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use bash
for the code blocks because that's what prism uses for the syntax highlighting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome!
grep.md
Outdated
### Pattern Options | ||
|
||
```bash | ||
-E, --extended-regexp # extended regular expression |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe add a brief summary of how ERE, BRE and PCRE differ, something like https://indigo.re/posts/2020-11-11-cli-regex.html#pattern-types
and maybe reorder from least powerful to most powerful: -F
, -G
, -E
, -P
```bash | ||
-A NUM, --after-context=NUM # print NUM lines after a match | ||
-B NUM, --before-context=NUM # print NUM lines before a match | ||
-C NUM, -NUM, --context=NUM # print NUM lines before and after a match |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
grep.md
Outdated
@@ -0,0 +1,64 @@ | |||
--- | |||
title: Grep |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This cheatsheet are options of GNU grep, not of POSIX grep. POSIX grep has much less options (one example: it doesn't have PCRE)
@hydrargyrum updated 👍 Let me know what you think. |
Awesome, thank you so much for this! |
This is awesome! |
This PR adds a cheatsheet for the
grep
command.Resolves #161
Closes #1170