utility

find

Traverse a tree; -type f selects regular files, -name matches a pattern, -exec ... {} + passes batches, -print0 emits NUL delimiters. Use owned roots.

Formal Syntax & Structure

bash syntaxbash
find START [EXPRESSION]

Parameters & Attributes

NameTypeDescription
STARTpathStarting directory.
EXPRESSIONexpressionTests and actions.

Return Value

exit status

Exit status 0 on success; nonzero indicates failure or a command-specific condition. See description and example.

Working Example

Example Snippetbash
mkdir dataprintf 'abc' > 'data/daily report.txt'find data -type f -name '*.txt' -exec wc -c {} +
Bash Reference