1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-02 22:58:01 +00:00

Add Grep For Multiple Patterns as a unix til

This commit is contained in:
jbranchaud
2016-01-23 23:19:21 -06:00
parent ca9440d6b4
commit 05845a1796
2 changed files with 13 additions and 0 deletions

View File

@@ -269,6 +269,7 @@ _305 TILs and counting..._
- [Find Newer Files](unix/find-newer-files.md)
- [Global Substitution On The Previous Command](unix/global-substitution-on-the-previous-command.md)
- [Grep For Files Without A Match](unix/grep-for-files-without-a-match.md)
- [Grep For Multiple Patterns](unix/grep-for-multiple-patterns.md)
- [Hexdump A Compiled File](unix/hexdump-a-compiled-file.md)
- [Kill Everything Running On A Certain Port](unix/kill-everything-running-on-a-certain-port.md)
- [Killing A Frozen SSH Session](unix/killing-a-frozen-ssh-session.md)

View File

@@ -0,0 +1,12 @@
# Grep For Multiple Patterns
You can use the `-e` flag with the `grep` command to search for a pattern.
Additionally, you can use multiple `-e` flags to search for multiple
patterns. For instance, if you want to search for occurrences of `ruby` and
`clojure` in a `README.md` file, use the following command:
```
$ grep -e ruby -e clojure README.md
```
See `man grep` for more details.