Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ find.bsd(1) — Domain/IX SR9.5

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

sh(1)

test(1)

FIND(1)

NAME

find − find files

USAGE

find pathname-list expression

DESCRIPTION

Find recursively descends the directory hierarchy for each pathname in the pathname-list, seeking files that match a Boolean expression written in the primaries given below.  The DOMAIN/IX implementation of find does not follow links. 

EXPRESSIONS

(In the descriptions below, the argument n is used as a decimal integer where +n means more than n, −n means less than n, and n means exactly n).

−name file True if file matches the current filename.  Normal Shell argument syntax may be used if escaped, but watch out for the left bracket ([), question mark (?), and asterisk (*) characters. 

−perm onum True if the file permission flags match the octal number onum precisely.  Information about file permissions can be found in chmod(1).  If onum is prefixed by a minus sign, more flag bits (017777) become significant and the flags are compared.  See stat(2) for details. 

−type c True if the type of the file is c, where c is b (block special file), c (character special file), d (directory), f (plain file), or l (softlink). 

−links n True if the file has n links. 

−user uname True if the file belongs to the user uname. If uname is numeric and does not appear as a log-in name in the /etc/passwd file, it is taken as a user ID. 

−group gname True if the file belongs to the group gname. If gname is numeric and does not appear in the /etc/group file, it is taken as a group ID. 

−size n True if the file is n blocks long (512 bytes per block). 

−inumn True if the file has inode number n.

−atime n True if the file has been accessed in n days. 

−mtime n True if the file has been modified in n days. 

−exec command True if the executed command returns a zero value as exit status.  The end of the command must be punctuated by a semicolon.  A command argument of { } is replaced by the current pathname.  Some shells treat braces and semicolons specially, so it is a good idea to protect them by escaping or quoting them. 

−ok command Like −exec, but prints the generated command line with a question mark first, and executes only if you respond by typing y. 

−print Always true; print the current pathname. 

−newer file True if the current file has been modified more recently than the argument file.

OPERATORS

The primaries listed above may be combined using the following operators (in order of decreasing precedence):

1) A group of primaries and operators in parentheses (parentheses are special to the Shell and must be escaped). 

2) The negation of a primary (!  is the unary not operator). 

3) Concatenation of primaries (the and operation is implied by the juxtaposition of two primaries). 

4) Alternation of primaries (−o is the or operator). 

EXAMPLE

To remove all files named a.out or *.o that have not been accessed for a week, type the following:

find / ( −name a.out −o −name ’*.o’ )−atime +7 −exec rm "{}" ";"

FILES

/etc/passwd
/etc/group

RELATED INFORMATION

sh(1), test(1). 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026