home *** CD-ROM | disk | FTP | other *** search
-
-
-
- FIND(1L) FIND(1L)
-
-
- NNAAMMEE
- find - search for files in a directory hierarchy
-
- SSYYNNOOPPSSIISS
- ffiinndd [path...] [expression]
-
- DDEESSCCRRIIPPTTIIOONN
- This manual page documents the GNU version of ffiinndd. ffiinndd
- searches the directory tree rooted at each given file name
- by evaluating the given expression from left to right,
- according to the rules of precedence (see section OPERA-
- TORS), until the outcome is known (the left hand side is
- false for _a_n_d operations, true for _o_r), at which point
- ffiinndd moves on to the next file name.
-
- The first argument that begins with `-', `(', `)', `,', or
- `!' is taken to be the beginning of the expression; any
- arguments before it are paths to search, and any arguments
- after it are the rest of the expression. If no paths are
- given, the current directory is used. If no expression is
- given, the expression `-print' is used.
-
- ffiinndd exits with status 0 if all files are processed suc-
- cessfully, greater than 0 if errors occur.
-
- EEXXPPRREESSSSIIOONNSS
- The expression is made up of options (which affect overall
- operation rather than the processing of a specific file,
- and always return true), tests (which return a true or
- false value), and actions (which have side effects and
- return a true or false value), all separated by operators.
- -and is assumed where the operator is omitted. If the
- expression contains no actions other than -prune, -print
- is performed on all files for which the expression is
- true.
-
- OOPPTTIIOONNSS
- All options always return true. They always take effect,
- rather than being processed only when their place in the
- expression is reached. Therefore, for clarity, it is best
- to place them at the beginning of the expression.
-
- -daystart
- Measure times (for -amin, -atime, -cmin, -ctime,
- -mmin, and -mtime) from the beginning of today
- rather than from 24 hours ago.
-
- -depth Process each directory's contents before the direc-
- tory itself.
-
- -follow
- Dereference symbolic links. Implies -noleaf.
-
-
-
-
-
- 1
-
-
-
-
-
- FIND(1L) FIND(1L)
-
-
- -help, --help
- Print a summary of the command-line usage of ffiinndd
- and exit.
-
- -maxdepth _l_e_v_e_l_s
- Descend at most _l_e_v_e_l_s (a non-negative integer)
- levels of directories below the command line argu-
- ments. `-maxdepth 0' means only apply the tests
- and actions to the command line arguments.
-
- -mindepth _l_e_v_e_l_s
- Do not apply any tests or actions at levels less
- than _l_e_v_e_l_s (a non-negative integer). `-mindepth
- 1' means process all files except the command line
- arguments.
-
- -mount Don't descend directories on other filesystems. An
- alternate name for -xdev, for compatibility with
- some other versions of ffiinndd.
-
- -noleaf
- Do not optimize by assuming that directories con-
- tain 2 fewer subdirectories than their hard link
- count. This option is needed when searching
- filesystems that do not follow the Unix directory-
- link convention, such as CD-ROM or MS-DOS filesys-
- tems or AFS volume mount points. Each directory on
- a normal Unix filesystem has at least 2 hard links:
- its name and its `.' entry. Additionally, its
- subdirectories (if any) each have a `..' entry
- linked to that directory. When ffiinndd is examining a
- directory, after it has statted 2 fewer subdirecto-
- ries than the directory's link count, it knows that
- the rest of the entries in the directory are non-
- directories (`leaf' files in the directory tree).
- If only the files' names need to be examined, there
- is no need to stat them; this gives a significant
- increase in search speed.
-
- -version, --version
- Print the ffiinndd version number and exit.
-
- -xdev Don't descend directories on other filesystems.
-
- TTEESSTTSS
- Numeric arguments can be specified as
-
- _+_n for greater than _n,
-
- _-_n for less than _n,
-
- _n for exactly _n.
-
-
-
-
-
- 2
-
-
-
-
-
- FIND(1L) FIND(1L)
-
-
- -amin _n
- File was last accessed _n minutes ago.
-
- -anewer _f_i_l_e
- File was last accessed more recently than _f_i_l_e was
- modified. -anewer is affected by -follow only if
- -follow comes before -anewer on the command line.
-
- -atime _n
- File was last accessed _n*24 hours ago.
-
- -cmin _n
- File's status was last changed _n minutes ago.
-
- -cnewer _f_i_l_e
- File's status was last changed more recently than
- _f_i_l_e was modified. -cnewer is affected by -follow
- only if -follow comes before -cnewer on the command
- line.
-
- -ctime _n
- File's status was last changed _n*24 hours ago.
-
- -empty File is empty and is either a regular file or a
- directory.
-
- -false Always false.
-
- -fstype _t_y_p_e
- File is on a filesystem of type _t_y_p_e. The valid
- filesystem types vary among different versions of
- Unix; an incomplete list of filesystem types that
- are accepted on some version of Unix or another is:
- ufs, 4.2, 4.3, nfs, tmp, mfs, S51K, S52K. You can
- use -printf with the %F directive to see the types
- of your filesystems.
-
- -gid _n File's numeric group ID is _n.
-
- -group _g_n_a_m_e
- File belongs to group _g_n_a_m_e (numeric group ID
- allowed).
-
- -ilname _p_a_t_t_e_r_n
- Like -lname, but the match is case insensitive.
-
- -iname _p_a_t_t_e_r_n
- Like -name, but the match is case insensitive. For
- example, the patterns `fo*' and `F??' match the
- file names `Foo', `FOO', `foo', `fOo', etc.
-
- -inum _n
- File has inode number _n.
-
-
-
-
- 3
-
-
-
-
-
- FIND(1L) FIND(1L)
-
-
- -ipath _p_a_t_t_e_r_n
- Like -path, but the match is case insensitive.
-
- -iregex _p_a_t_t_e_r_n
- Like -regex, but the match is case insensitive.
-
- -links _n
- File has _n links.
-
- -lname _p_a_t_t_e_r_n
- File is a symbolic link whose contents match shell
- pattern _p_a_t_t_e_r_n. The metacharacters do not treat
- `/' or `.' specially.
-
- -mmin _n
- File's data was last modified _n minutes ago.
-
- -mtime _n
- File's data was last modified _n*24 hours ago.
-
- -name _p_a_t_t_e_r_n
- Base of file name (the path with the leading direc-
- tories removed) matches shell pattern _p_a_t_t_e_r_n. The
- metacharacters (`*', `?', and `[]') do not match a
- `.' at the start of the base name. To ignore a
- directory and the files under it, use -prune; see
- an example in the description of -path.
-
- -newer _f_i_l_e
- File was modified more recently than _f_i_l_e. -newer
- is affected by -follow only if -follow comes before
- -newer on the command line.
-
- -nouser
- No user corresponds to file's numeric user ID.
-
- -nogroup
- No group corresponds to file's numeric group ID.
-
- -path _p_a_t_t_e_r_n
- File name matches shell pattern _p_a_t_t_e_r_n. The
- metacharacters do not treat `/' or `.' specially;
- so, for example,
- find . -path './sr*sc'
- will print an entry for a directory called
- './src/misc' (if one exists). To ignore a whole
- directory tree, use -prune rather than checking
- every file in the tree. For example, to skip the
- directory `src/emacs' and all files and directories
- under it, and print the names of the other files
- found, do something like this:
- find . -path './src/emacs' -prune -o
- -print
-
-
-
-
- 4
-
-
-
-
-
- FIND(1L) FIND(1L)
-
-
- -perm _m_o_d_e
- File's permission bits are exactly _m_o_d_e (octal or
- symbolic). Symbolic modes use mode 0 as a point of
- departure.
-
- -perm -_m_o_d_e
- All of the permission bits _m_o_d_e are set for the
- file.
-
- -perm +_m_o_d_e
- Any of the permission bits _m_o_d_e are set for the
- file.
-
- -regex _p_a_t_t_e_r_n
- File name matches regular expression _p_a_t_t_e_r_n. This
- is a match on the whole path, not a search. For
- example, to match a file named `./fubar3', you can
- use the regular expression `.*bar.' or `.*b.*3',
- but not `b.*r3'.
-
- -size _n[bckw]
- File uses _n units of space. The units are 512-byte
- blocks by default or if `b' follows _n, bytes if `c'
- follows _n, kilobytes if `k' follows _n, or 2-byte
- words if `w' follows _n. The size does not count
- indirect blocks, but it does count blocks in sparse
- files that are not actually allocated.
-
- -true Always true.
-
- -type _c
- File is of type _c:
-
- b block (buffered) special
-
- c character (unbuffered) special
-
- d directory
-
- p named pipe (FIFO)
-
- f regular file
-
- l symbolic link
-
- s socket
-
- -uid _n File's numeric user ID is _n.
-
- -used _n
- File was last accessed _n days after its status was
- last changed.
-
-
-
-
-
- 5
-
-
-
-
-
- FIND(1L) FIND(1L)
-
-
- -user _u_n_a_m_e
- File is owned by user _u_n_a_m_e (numeric user ID
- allowed).
-
- -xtype _c
- The same as -type unless the file is a symbolic
- link. For symbolic links: if -follow has not been
- given, true if the file is a link to a file of type
- _c; if -follow has been given, true if _c is `l'. In
- other words, for symbolic links, -xtype checks the
- type of the file that -type does not check.
-
- AACCTTIIOONNSS
- -exec _c_o_m_m_a_n_d ;
- Execute _c_o_m_m_a_n_d; true if 0 status is returned. All
- following arguments to ffiinndd are taken to be argu-
- ments to the command until an argument consisting
- of `;' is encountered. The string `{}' is replaced
- by the current file name being processed everywhere
- it occurs in the arguments to the command, not just
- in arguments where it is alone, as in some versions
- of ffiinndd. Both of these constructions might need to
- be escaped (with a `\') or quoted to protect them
- from expansion by the shell. The command is exe-
- cuted in the starting directory.
-
- -fls _f_i_l_e
- True; like -ls but write to _f_i_l_e like -fprint.
-
- -fprint _f_i_l_e
- True; print the full file name into file _f_i_l_e. If
- _f_i_l_e does not exist when ffiinndd is run, it is cre-
- ated; if it does exist, it is truncated. The file
- names ``/dev/stdout'' and ``/dev/stderr'' are han-
- dled specially; they refer to the standard output
- and standard error output, respectively.
-
- -fprint0 _f_i_l_e
- True; like -print0 but write to _f_i_l_e like -fprint.
-
- -fprintf _f_i_l_e _f_o_r_m_a_t
- True; like -printf but write to _f_i_l_e like -fprint.
-
- -ok _c_o_m_m_a_n_d ;
- Like -exec but ask the user first (on the standard
- input); if the response does not start with `y' or
- `Y', do not run the command, and return false.
-
- -print True; print the full file name on the standard out-
- put, followed by a newline.
-
- -print0
- True; print the full file name on the standard out-
- put, followed by a null character. This allows
-
-
-
- 6
-
-
-
-
-
- FIND(1L) FIND(1L)
-
-
- file names that contain newlines to be correctly
- interpreted by programs that process the ffiinndd out-
- put.
-
- -printf _f_o_r_m_a_t
- True; print _f_o_r_m_a_t on the standard output, inter-
- preting `\' escapes and `%' directives. Field
- widths and precisions can be specified as with the
- `printf' C function. Unlike -print, -printf does
- not add a newline at the end of the string. The
- escapes and directives are:
-
- \a Alarm bell.
-
- \b Backspace.
-
- \c Stop printing from this format immediately
- and flush the output.
-
- \f Form feed.
-
- \n Newline.
-
- \r Carriage return.
-
- \t Horizontal tab.
-
- \v Vertical tab.
-
- \\ A literal backslash (`\').
-
- A `\' character followed by any other character is
- treated as an ordinary character, so they both are
- printed.
-
- %% A literal percent sign.
-
- %a File's last access time in the format
- returned by the C `ctime' function.
-
- %A_k File's last access time in the format speci-
- fied by _k, which is either `@' or a direc-
- tive for the C `strftime' function. The
- possible values for _k are listed below; some
- of them might not be available on all sys-
- tems, due to differences in `strftime'
- between systems.
-
- @ seconds since Jan. 1, 1970, 00:00
- GMT.
-
- Time fields:
-
- H hour (00..23)
-
-
-
- 7
-
-
-
-
-
- FIND(1L) FIND(1L)
-
-
- I hour (01..12)
-
- k hour ( 0..23)
-
- l hour ( 1..12)
-
- M minute (00..59)
-
- p locale's AM or PM
-
- r time, 12-hour (hh:mm:ss [AP]M)
-
- S second (00..61)
-
- T time, 24-hour (hh:mm:ss)
-
- X locale's time representation (H:M:S)
-
- Z time zone (e.g., EDT), or nothing if
- no time zone is determinable
-
- Date fields:
-
- a locale's abbreviated weekday name
- (Sun..Sat)
-
- A locale's full weekday name, variable
- length (Sunday..Saturday)
-
- b locale's abbreviated month name
- (Jan..Dec)
-
- B locale's full month name, variable
- length (January..December)
-
- c locale's date and time (Sat Nov 04
- 12:02:33 EST 1989)
-
- d day of month (01..31)
-
- D date (mm/dd/yy)
-
- h same as b
-
- j day of year (001..366)
-
- m month (01..12)
-
- U week number of year with Sunday as
- first day of week (00..53)
-
- w day of week (0..6)
-
- W week number of year with Monday as
-
-
-
- 8
-
-
-
-
-
- FIND(1L) FIND(1L)
-
-
- first day of week (00..53)
-
- x locale's date representation
- (mm/dd/yy)
-
- y last two digits of year (00..99)
-
- Y year (1970...)
-
- %b File's size in 512-byte blocks (rounded up).
-
- %c File's last status change time in the format
- returned by the C `ctime' function.
-
- %C_k File's last status change time in the format
- specified by _k, which is the same as for %A.
-
- %d File's depth in the directory tree; 0 means
- the file is a command line argument.
-
- %f File's name with any leading directories
- removed (only the last element).
-
- %F Type of the filesystem the file is on; this
- value can be used for -fstype.
-
- %g File's group name, or numeric group ID if
- the group has no name.
-
- %G File's numeric group ID.
-
- %h Leading directories of file's name (all but
- the last element).
-
- %H Command line argument under which file was
- found.
-
- %i File's inode number (in decimal).
-
- %k File's size in 1K blocks (rounded up).
-
- %l Object of symbolic link (empty string if
- file is not a symbolic link).
-
- %m File's permission bits (in octal).
-
- %n Number of hard links to file.
-
- %p File's name.
-
- %P File's name with the name of the command
- line argument under which it was found
- removed.
-
-
-
-
- 9
-
-
-
-
-
- FIND(1L) FIND(1L)
-
-
- %s File's size in bytes.
-
- %t File's last modification time in the format
- returned by the C `ctime' function.
-
- %T_k File's last modification time in the format
- specified by _k, which is the same as for %A.
-
- %u File's user name, or numeric user ID if the
- user has no name.
-
- %U File's numeric user ID.
-
- A `%' character followed by any other character is
- discarded (but the other character is printed).
-
- -prune If -depth is not given, true; do not descend the
- current directory.
- If -depth is given, false; no effect.
-
- -ls True; list current file in `ls -dils' format on
- standard output. The block counts are of 1K
- blocks, unless the environment variable
- POSIXLY_CORRECT is set, in which case 512-byte
- blocks are used.
-
- OOPPEERRAATTOORRSS
- Listed in order of decreasing precedence:
-
- ( _e_x_p_r )
- Force precedence.
-
- ! _e_x_p_r True if _e_x_p_r is false.
-
- -not _e_x_p_r
- Same as ! _e_x_p_r.
-
- _e_x_p_r_1 _e_x_p_r_2
- And (implied); _e_x_p_r_2 is not evaluated if _e_x_p_r_1 is
- false.
-
- _e_x_p_r_1 -a _e_x_p_r_2
- Same as _e_x_p_r_1 _e_x_p_r_2.
-
- _e_x_p_r_1 -and _e_x_p_r_2
- Same as _e_x_p_r_1 _e_x_p_r_2.
-
- _e_x_p_r_1 -o _e_x_p_r_2
- Or; _e_x_p_r_2 is not evaluated if _e_x_p_r_1 is true.
-
- _e_x_p_r_1 -or _e_x_p_r_2
- Same as _e_x_p_r_1 -o _e_x_p_r_2.
-
-
-
-
-
- 10
-
-
-
-
-
- FIND(1L) FIND(1L)
-
-
- _e_x_p_r_1 , _e_x_p_r_2
- List; both _e_x_p_r_1 and _e_x_p_r_2 are always evaluated.
- The value of _e_x_p_r_1 is discarded; the value of the
- list is the value of _e_x_p_r_2.
-
- SSEEEE AALLSSOO
- llooccaattee(1L), llooccaatteeddbb(5L), uuppddaatteeddbb(1L), xxaarrggss(1L) FFiinnddiinngg
- FFiilleess (on-line in Info, or printed)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 11
-
-
-