commands
find — walk a directory tree
Evaluates tests and actions for entries under starting paths. Quote glob patterns. GNU -maxdepth bounds traversal; -print0 preserves pathname boundaries. Zero for successful traversal, not necessarily a match. Avoid destructive actions on unreviewed results. Example assumes a fresh search-transform lab fixture.
Formal Syntax & Structure
linux syntaxlinux
find PATH... [EXPRESSION]Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| PATH | operand | starting directory |
| -type | option | entry type |
| -name | option | basename glob |
| -maxdepth | option | depth limit |
| -print0 | option | NUL-delimited output |
Return Value
exit status and output
Evaluates tests and actions for entries under starting paths. Quote glob patterns. GNU -maxdepth bounds traversal; -print0 preserves pathname boundaries. Zero for successful traversal, not necessarily a match. Avoid destructive actions on unreviewed results.
Working Example
Example Snippetlinux
find docs -type f -name '*.log' -print