find(1) - SerenityOS man pages

#Name

find - recursively search for files

#Synopsis

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

#Description

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.

#Options

#Commands

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

Commands which take a numeric argument n (-links and -size for example), may be prefixed by a plus sign ('+') or a minus sign ('-'). A plus sign means "grater than n", while a minus sign means "less than n". A numeric argument with no prefix means "exactly equal".

#Examples

# 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