find(1) - SerenityOS man pages


find - recursively search for files


$ find [-L] [root-paths...] [commands...]


find recursively traverses the file hierarchy starting at the given root paths (or at the current working directory if no root paths have been specified), and evaluates the given commands for each found file. The commands can be used to both filter the set of files and to perform actions on them.

If no action command (-print, -print0, or -exec) is found among the specified commands, a -print command is implicitly appended.



The commands can be combined to form complex expressions using the following operators:


# Output a tree of paths rooted at the current directory:
$ find
# Output only directories:
$ find -type d
# Remove all sockets and any files owned by anon in /tmp:
$ find /tmp "(" -type s -o -user anon ")" -exec rm "{}" ";"
# Concatenate files with weird characters in their names:
$ find -type f -print0 | xargs -0 cat
# Find files with the word "config" in their name:
$ find -name \*config\*

See also