[0m


FIND(1)             UNIX Programmer's Manual		  FIND(1)



[1mNAME
     [0mfind - find files

[1mSYNOPSIS
     find [0mpathname-list expression
     [1mfind [0mpattern

[1mDESCRIPTION
     [0mIn the first form above, _f_i_n_d recursively descends the
     directory hierarchy for each pathname in the _p_a_t_h_n_a_m_e-_l_i_s_t
     (i.e., one or more pathnames) seeking files that match a
     boolean _e_x_p_r_e_s_s_i_o_n 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 second form rapidly searches a database for all path-
     names which match _p_a_t_t_e_r_n.  Usually the database is recom-
     puted weekly (by running the the script
     /_u_s_r/_l_i_b/_f_i_n_d/_u_p_d_a_t_e_d_b from the weekly administration script
     /_v_a_r/_a_d_m/_w_e_e_k_l_y) and contains the pathnames of all files
     which are publicly accessible.  If escaped, normal shell
     "globbing" characters (`*', `?', `[', and ']') may be used
     in _p_a_t_t_e_r_n, but the matching differs in that no characters
     (_e._g. `/') have to be matched explicitly.	As a special
     case, a simple _p_a_t_t_e_r_n containing no globbing characters is
     matched as though it were *_p_a_t_t_e_r_n*; if any globbing charac-
     ter appears there are no implicit globbing characters.

     [1m-fstype [0mtype
	       True if the filesystem to which the file belongs
	       matches _t_y_p_e.  _T_y_p_e is usually either [1m4.3 [0mor [1mnfs[0m.

     [1m-name [0mfilename
	       True if the _f_i_l_e_n_a_m_e argument matches the current
	       file name.  Normal shell argument syntax may be
	       used if escaped (watch out for `[', `?' and `*').

     [1m-perm [0monum
	       True if the file permission flags exactly match
	       the octal number _o_n_u_m (see _c_h_m_o_d(1)).  If _o_n_u_m is
	       prefixed by a minus sign, more flag bits (017777,
	       see _s_t_a_t(2)) become significant and the flags are
	       compared: (_f_l_a_g_s&_o_n_u_m)==_o_n_u_m.

     [1m-prune    [0mAlways true, but has the side effect of not des-
	       cending if the current file is a directory.

     [1m-type [0mc   True if the type of the file is _c, where _c is [1mb,
	       c, d, f, p, l [0mor [1ms [0mfor block special file, charac-
	       ter special file, directory, plain file, pipe,
	       symbolic link, or socket.



Printed 7/11/91     Revision 1.9 of 07/10/90			1






FIND(1)             UNIX Programmer's Manual		  FIND(1)



     [1m-links [0mn  True if the file has _n links.

     [1m-user [0muname
	       True if the file belongs to the user _u_n_a_m_e (login
	       name or numeric user ID).

     [1m-nouser   [0mTrue if the file belongs to a user _n_o_t in the
	       /etc/passwd database.

     [1m-group [0mgname
	       True if the file belongs to group _g_n_a_m_e (group
	       name or numeric group ID).

     [1m-nogroup  [0mTrue if the file belongs to a group _n_o_t in the
	       /etc/group database.

     [1m-size [0mn[1m[[0mc[1m]
	       [0mTrue if the file is _n blocks long (512 bytes per
	       block).	If _n is followed by a _c, then the size is
	       in bytes.

     [1m-inum [0mn   True if the file has inode number _n.

     [1m-atime [0mn  True if the file has been accessed in _n days.

     [1m-mtime [0mn  True if the file has been modified in _n days.

     [1m-ctime [0mn  True if the file has been changed in _n days.
	       `Changed' means that either the contents or some
	       attribute of the file have been modified within
	       the time specified.

     [1m-exec [0mcommand
	       True if the executed command returns a zero value
	       as exit status.	The end of the command must be
	       punctuated by an escaped semicolon.  A command
	       argument `{}' is replaced by the current pathname.

     [1m-ok [0mcommand
	       Like [1m-exec [0mexcept that the generated command is
	       written on the standard output, then the standard
	       input is read and the command executed only upon
	       response [1my[0m.

     [1m-print    [0mAlways true; causes the current pathname to be
	       printed.

     [1m-ls       [0mAlways true; causes current pathname to be printed
	       together with its associated statistics.  These
	       include (respectively) inode number, size in kilo-
	       bytes (1024 bytes), protection mode, number of
	       hard links, user, group, size in bytes, and



Printed 7/11/91     Revision 1.9 of 07/10/90			2






FIND(1)             UNIX Programmer's Manual		  FIND(1)



	       modification time.  If the file is a special file
	       the size field will instead contain the major and
	       minor device numbers.  If the file is a symbolic
	       link the pathname of the linked-to file is printed
	       preceded by ``->''.  The format is identical to
	       that of ``ls -gilds'' (note however that format-
	       ting is done internally, without executing the ls
	       program).

     [1m-newer [0mfile
	       True if the current file has been modified more
	       recently than the argument _f_i_l_e.

     [1m-cpio [0mfile
	       Write the current file on the argument _f_i_l_e in
	       _c_p_i_o format, with large blocksize, i.e. with a
	       blocksize of 5120 bytes. This blocksize is compa-
	       tible with the [1m-B [0moption of [1mcpio[0m.

     [1m-ncpio [0mfile
	       Write the current file on the argument _f_i_l_e in
	       character-header _c_p_i_o format, with large block-
	       size. This format is compatible with the [1m-c [0moption
	       of [1mcpio[0m, (however the latter always reads the
	       first block to determine whether the file was
	       created using [1m-cpio [0mor [1m-ncpio[0m.  It is therefore
	       unnecessary to specify the [1m-c [0moption to [1mcpio[0m).
	       This format is preferable for portability, but the
	       destination file is larger.

     [1m-depth    [0mSearch subdirectories of each directory recur-
	       sively before examining the contents directory
	       itself. This is automatically implied by the [1m-cpio
	       [0mand [1m-ncpio [0moptions. This enables the modification
	       and access times of the directory to be restored
	       after the contents of the directory have been
	       recovered, as normally the act of recovering the
	       files updates the modification time of the con-
	       taining directories.

     [1m-xdev     [0mAlways true; causes find _n_o_t to traverse down into
	       a file system different from the one on which
	       current _a_r_g_u_m_e_n_t pathname resides.

     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 _n_o_t



Printed 7/11/91     Revision 1.9 of 07/10/90			3






FIND(1)             UNIX Programmer's Manual		  FIND(1)



	 operator).

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

     4)  Alternation of primaries (`[1m-o[0m' is the _o_r operator).

[1mEXAMPLES
     [0mTo find all accessible files whose pathname contains `find':

	  find find

     To typeset all variants of manual pages for `ls':

	  vtroff -man `find '*man*/ls.?'`

     To remove all files named `a.out' or `*.o' that have not
     been accessed for a week:

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

     To recursively print all file names in the current directory
     and below, but ignoring the contents of all RCS directories:

	  find . -print -name RCS -prune

[1mFILES
     [0m/etc/passwd
     /etc/group
     /var/find/find.codes     coded pathnames database

[1mSEE ALSO
     [0m_s_h(_1), _t_e_s_t(_1), _c_p_i_o(_1), _c_p_i_o(_5), _f_s(_5).
     Relevant paper in February, 1983 issue of ;_l_o_g_i_n:.

[1mBUGS
     [0mThe first form's syntax is painful, and the second form's
     exact semantics is confusing and can vary from site to site.

     More than one `-newer' option does not work properly.














Printed 7/11/91     Revision 1.9 of 07/10/90			4



[0m