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

NameTypeDescription
PATHoperandstarting directory
-typeoptionentry type
-nameoptionbasename glob
-maxdepthoptiondepth limit
-print0optionNUL-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
Linux Reference