mirror of
https://github.com/jbranchaud/til
synced 2026-01-02 22:58:01 +00:00
Add Grep For Files Without A Match as a unix til.
This commit is contained in:
@@ -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)
|
||||
|
||||
14
unix/grep-for-files-without-a-match.md
Normal file
14
unix/grep-for-files-without-a-match.md
Normal file
@@ -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)
|
||||
Reference in New Issue
Block a user