Manual / find
find(1)
| FIND(1) | General Commands Manual | FIND(1) |
NAME
find - find files
SYNOPSIS
find pathname [expression]
DESCRIPTION
Find recursively descends the directory hierarchy from pathname seeking files that match a boolean expression written in the primaries given below. In numeric tests, +n means more than n, -n less than n, and n exactly n.
- -name pattern
- Match the entry's name against a shell pattern.
- -path pattern
- Match the whole walked pathname against a shell pattern.
- -type f|d
- Select ordinary files or directories.
- -newer file
- Compare modification timestamps with the named reference file.
- -mtime [+-]n
- Compare modification age in calendar days, ignoring time of day. Without a usable clock this test is false.
- -size [+-]n[c]
- Compare file length in rounded-up 512-byte units; append c for bytes.
- -links [+-]n
- Compare a link count of 1: ProDOS has no hard links.
- -xdev
- Accepted; the traversal cannot cross a ProDOS volume boundary.
- -nouser, -nogroup
- Accepted as constant true: there are no account or group databases.
- Print the current pathname; true.
- -prune
- Do not descend into this directory; true.
- -exec command ... ;
- True if the executed command returns exit status zero. The end of the command is punctuated by a quoted semicolon. A command argument '{}' is replaced by the current pathname.
- -ok command ... ;
- Like -exec, but first write < command ... pathname > ? to the standard error and read one reply line from the terminal (the standard error, which stays the console when the standard input is a file). The command runs only if the reply begins with y or Y; otherwise the primary is false and nothing runs. Where standard error is not a terminal every reply is taken as no.
- -depth
- Always true. Act on the entries of a directory before the directory itself, so a tree is listed deepest first. -prune has no effect when -depth is given.
The operators, in decreasing precedence, are ! (not), -a (and, also implied by adjacency), and -o (or). And/or short-circuit; parentheses group expressions. Quote parentheses, pattern metacharacters and the semicolon for the shell:
find . -name '*.S' -exec echo '{}' ';'
If there is no -print, -exec or -ok, a -print is implicitly ANDed with the complete expression.
FILES
/usr/man/FIND this page
SEE ALSO
DIAGNOSTICS
Exit status is 0 on a successful walk, 1 for access/path/spawn failures, 2 for syntax, complexity or traversal-depth errors. A child's nonzero -exec status makes that primary false, not itself an execution failure.
BUGS
One starting path is accepted. The walk is limited to eight directory frames and 64-character full paths; at most three -exec primaries are allowed. No -perm, -user or -group: ProDOS files have no permission bits, owner or group to test, so the primaries are refused (exit status 2) rather than invented.
| October 8, 2026 | maux |