Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ find(1) — UTek 4.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cpio(1)

du(1)

sh(1sh)

test(1sh)

cpio(5)

fs(5)



FIND(1)                 COMMAND REFERENCE                 FIND(1)



NAME
     find - find files

SYNOPSIS
     find pathname-list [ expression ]

DESCRIPTION
     The find command recursively descends the directory
     hierarchy for each path name in the pathname-list (i.e., one
     or more path names) seeking files that match a boolean
     expression written in the primaries given below.  In the
     descriptions, 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.

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

     1) A parenthesized group of primaries and operators
        (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).  Note that the
        primaries -print, -follow, -cpio, -prune, -xdev, and -
        exec are always true and always perform their operations
        when they are evaluated.

     4) Alternation of primaries (`-o' is the or operator).

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

     -cpio name  Write the current file to the file name in
                 cpio(5) format (5120 byte records).

     -exec command
                 True if the executed command returns a zero
                 value as exit status.  The end of the command
                 must be punctuated by a space followed by an
                 escaped semicolon.  A command argument `{ }' is
                 replaced by the current path name.

     -follow type
                 Always true.  This option determines whether
                 symbolic links to directories will be followed;
                 by default, symbolic links to directories are
                 followed.




Printed 4/6/89                                                  1





FIND(1)                 COMMAND REFERENCE                 FIND(1)



                 The option h type means that symbolic links to
                 directories are not to be followed (in other
                 words, follow only ``hard'' links).

     -group gname
                 True if the file belongs to group gname (group
                 name or numeric group ID).

     -inum n     True if the file has inode number n.

     -links n    True if the file has n links.

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

     -name filename
                 True if the filename argument matches the
                 current file name.  Normal shell argument syntax
                 may be used if escaped (watch out for [ , ? ,
                 and  * ).

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

     -ok command Like -exec except that the generated command is
                 written on the standard output, then the
                 standard input is read and the command is
                 executed only upon response y.

     -perm onum  True if the file permission flags exactly match
                 the octal number onum (see chmod(1)).  If onum
                 is prefixed by a minus sign, more flag bits
                 (017777, see stat(2)) become significant and the
                 flags are compared: (flags&onum)==onum.

     -print      Always true; causes the current path name to be
                 printed.

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

     -type c     True if the type of the file is c, where c is b,
                 c, d, f or l for block special file, character
                 special file, directory, plain file, or symbolic
                 link.  unless the search starts from  /,  a
                 symbolic link to a file has both type l and the
                 type of file pointed to by the symbolic link,
                 except in the case of symbolic links to
                 nonexistent files.

     -user uname True if the file belongs to the user uname
                 (login name or numeric user ID).




Printed 4/6/89                                                  2





FIND(1)                 COMMAND REFERENCE                 FIND(1)



     -fstype type
                 True if the file system to which the file
                 belongs is of type type, where type is typically
                 4.2 or nfs.

     -prune      Always yields true; has the side effect of
                 pruning the search tree at the file.  That is,
                 if the current path name is a directory, find
                 will not descend into that directory.

     -xdev       Always true, causes find not to traverse down
                 into a file system different from the one on
                 which current argument path name resides.

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

          find / \( -name a.out -o -name '*.o' \) -atime +7 -exec rm {} \;

     To find all directories in the local file system named src,
     assuming no src directory is found under any other src
     directory in the file system, type:

          find / -fstype 4.2 -name src -prune -print

FILES
     /etc/passwd
               System user information

     /etc/group
               System group information

RETURN VALUE
     [NO_ERRS]      Command completed without error.

     [USAGE]        Incorrect command line syntax. Execution
                    terminated.

     [NP_WARN]      An error warranting a warning message
                    occurred. Execution continues.

     [NP_ERR]       An error occurred that was not a system
                    error.  Execution terminated.

     [P_WARN]       A system error occurred. Execution continues.
                    See intro(2) for more information on system
                    errors.

     [P_ERR]        A system error occurred. Execution
                    terminated.  See intro(2) for more
                    information on system errors.



Printed 4/6/89                                                  3





FIND(1)                 COMMAND REFERENCE                 FIND(1)



CAVEATS
     Note that the semicolon following the -exec or -ok arguments
     must be a separate argument.

     Symbolic links to directories are treated just like normal
     directories, unless the search starts from /;  in order to
     do this, information about each directory is stored.

     No directory is ever searched more than once.

     There is no way to selectively follow symbolic links to
     directories.

     The -cpio option does not know about symbolic links.  When a
     symbolic link is encountered, the file pointed to by the
     link is archived.

SEE ALSO
     cpio(1), du(1), sh(1sh), test(1sh), cpio(5), and fs(5).




































Printed 4/6/89                                                  4





































































%%index%%
na:240,69;
sy:309,213;
de:522,1656;
op:2178,1097;3587,3203;7102,885;
ex:7987,512;
fi:8499,204;
rv:8703,835;
ca:9850,780;
se:10630,229;
%%index%%000000000168

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