From 05845a17969bd21c54fca4fa17615d96c96904f7 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Sat, 23 Jan 2016 23:19:21 -0600 Subject: [PATCH] Add Grep For Multiple Patterns as a unix til --- README.md | 1 + unix/grep-for-multiple-patterns.md | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 unix/grep-for-multiple-patterns.md diff --git a/README.md b/README.md index b4d28ee..5ba2bf7 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/unix/grep-for-multiple-patterns.md b/unix/grep-for-multiple-patterns.md new file mode 100644 index 0000000..ef3b1e1 --- /dev/null +++ b/unix/grep-for-multiple-patterns.md @@ -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.