Howto grep » Historie » Version 2
Jeremias Keihsler, 25.05.2019 12:30
| 1 | 1 | Jeremias Keihsler | h1. Howto grep |
|---|---|---|---|
| 2 | |||
| 3 | h2. find files with a specific content |
||
| 4 | |||
| 5 | this is taken from: https://tecadmin.net/find-all-files-containing-specific-text-on-linux/ |
||
| 6 | |||
| 7 | this will search all files recursively for the given term |
||
| 8 | <pre><code class="bash"> |
||
| 9 | grep -rwl “search-string” /path/to/search/dir |
||
| 10 | </code></pre> |
||
| 11 | |||
| 12 | <pre><code class="bash"> |
||
| 13 | 2 | Jeremias Keihsler | grep -rwl “CentOS” /etc |
| 14 | 1 | Jeremias Keihsler | </code></pre> |
| 15 | 2 | Jeremias Keihsler | should output a few files |