home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Interactive Guide / c-cplusplus-interactive-guide.iso / c_ref / csource4 / 224_01 / find.hlp < prev    next >
Encoding:
Text File  |  1987-01-06  |  2.3 KB  |  63 lines

  1. NAME
  2.      find - find files
  3.  
  4. SYNTAX
  5.      find  pathname-list  expressions
  6.  
  7. DESCRIPTION
  8.     Find recursively descends the directory hierarchy for each pathname in 
  9.     the pathname-list (i.e., one or more pathnames) seeking files that match 
  10.     a boolean expression written in the primaries given below.  The option 
  11.     names have to have lower case letters.
  12.  
  13.      -name filename
  14.         True if the filename argument matches the current file name.  
  15.         Enclose the filename with single quotes if wildcards for 
  16.         filenames are used.
  17.  
  18.      -time n    True if the file has been modified in n days.  The -name option
  19.         has to be used in conjunction with the -time option.
  20.                 The argument n is a decimal integer where 
  21.             +n means more than n, 
  22.             -n means less than n and 
  23.              n means exactly n.
  24.  
  25.      -newer file
  26.         True if the current file has been modified more recently than 
  27.         the argument file.  The -name option has to be used in 
  28.         conjunction with the -newer option.
  29.  
  30.      -exec command
  31.         True if the executed command returns a zero value as exit
  32.                 status.  The end of the command must have a semicolon.  
  33.                 A command argument '{}' is replaced by the current pathname.
  34.         If the -name option is used, '{}' is replaced by the current
  35.         filename with its full path.
  36.  
  37.      -ok command
  38.         Like -exec except that the generated command is written on the 
  39.         standard output, then the standard input is read and the 
  40.         command is executed only upon response 'y' or 'Y'.
  41.  
  42.      -print     Always true; causes the current pathname to be printed.  If
  43.         the -name option is used, the current filename with its full 
  44.         path is printed.
  45.         
  46.      -dir       Always true; cause the current pathname (or filename) to be 
  47.         printed in a long directory format.
  48.  
  49.     -all        All types of files including directories will be sought. 
  50.                 This is normally used with the "-name" option.
  51.  
  52. EXAMPLE
  53.      To remove all files named '*.o' that have not been modified for a week:
  54.  
  55.     find \ -name '*.o' -time +7 -exec rm {} ;
  56.     
  57.     To list all the directories on the default drive:
  58.     
  59.     find \ -print
  60.  
  61. SEE ALSO
  62.      test
  63.