Walk a directory/Recursively: Difference between revisions
Content added Content deleted
Line 1,529: | Line 1,529: | ||
=={{header|UNIX Shell}}== |
=={{header|UNIX Shell}}== |
||
{{works with|Bourne Again SHell}} |
{{works with|Bourne Again SHell}} |
||
The "find" command gives a one-line solution for simple patterns: |
|||
<lang bash>find . -name '*.txt'</lang> |
|||
"find" can also be used to find files matching more complex patterns as illustrated in the section on [[#UnixPipes|Unix Pipes]] below. |
|||
Here is a solution that does not use "find". |
|||
<lang bash>#! /bin/bash |
<lang bash>#! /bin/bash |
||