From a52beaffe4e7544675ddfb2dc2f9e2c7b9e6c241 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Wed, 20 Jan 2016 19:39:53 -0600 Subject: [PATCH] Add Grep For Files Without A Match as a unix til. --- README.md | 1 + unix/grep-for-files-without-a-match.md | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 unix/grep-for-files-without-a-match.md diff --git a/README.md b/README.md index 0753ec3..f5283ac 100644 --- a/README.md +++ b/README.md @@ -265,6 +265,7 @@ smart people at [Hashrocket](http://hashrocket.com/). - [File Type Info With File](unix/file-type-info-with-file.md) - [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) - [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-files-without-a-match.md b/unix/grep-for-files-without-a-match.md new file mode 100644 index 0000000..4eac6b1 --- /dev/null +++ b/unix/grep-for-files-without-a-match.md @@ -0,0 +1,14 @@ +# Grep For Files Without A Match + +The `grep` command is generally used to find files whose contents match a +pattern. With the `-L` (`--files-without-match`) flag, `grep` can be used to +find files that don't match the given pattern. + +For instance, to find files in the current directory that don't have +`foobar` anywhere in their content, run: + +```bash +$ grep -L "foobar" ./* +``` + +[source](http://stackoverflow.com/questions/1748129/using-grep-to-find-files-that-dont-contain-a-given-string-pattern)