home *** CD-ROM | disk | FTP | other *** search
- NAME
- find - find files
-
- SYNTAX
- find pathname-list expressions
-
- DESCRIPTION
- Find recursively descends the directory hierarchy for each pathname in
- the pathname-list (i.e., one or more pathnames) seeking files that match
- a boolean expression written in the primaries given below. The option
- names have to have lower case letters.
-
- -name filename
- True if the filename argument matches the current file name.
- Enclose the filename with single quotes if wildcards for
- filenames are used.
-
- -time n True if the file has been modified in n days. The -name option
- has to be used in conjunction with the -time option.
- The argument n is a decimal integer where
- +n means more than n,
- -n means less than n and
- n means exactly n.
-
- -newer file
- True if the current file has been modified more recently than
- the argument file. The -name option has to be used in
- conjunction with the -newer option.
-
- -exec command
- True if the executed command returns a zero value as exit
- status. The end of the command must have a semicolon.
- A command argument '{}' is replaced by the current pathname.
- If the -name option is used, '{}' is replaced by the current
- filename with its full path.
-
- -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' or 'Y'.
-
- -print Always true; causes the current pathname to be printed. If
- the -name option is used, the current filename with its full
- path is printed.
-
- -dir Always true; cause the current pathname (or filename) to be
- printed in a long directory format.
-
- -all All types of files including directories will be sought.
- This is normally used with the "-name" option.
-
- EXAMPLE
- To remove all files named '*.o' that have not been modified for a week:
-
- find \ -name '*.o' -time +7 -exec rm {} ;
-
- To list all the directories on the default drive:
-
- find \ -print
-
- SEE ALSO
- test