Bash find files containing » Historie » Version 1
Jeremias Keihsler, 13.01.2017 10:44
1 | 1 | Jeremias Keihsler | h1. Bash find files containing |
---|---|---|---|
2 | |||
3 | <pre><code class="bash"> |
||
4 | find /etc -type f | xargs grep 'iptables' |
||
5 | </code></pre> |
||
6 | |||
7 | where: |
||
8 | find is what you want to do, @/etc@ is the directory to search in, @-type f@ is a regular file (as opposed to device or other type), @|@ to pipe the command through @xargs@ and @grep@, grep for pattern matching, 'iptables' the pattern to match. |