home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V6 / usr / man / man1 / find.1 < prev    next >
Encoding:
Text File  |  1975-06-26  |  2.8 KB  |  169 lines

  1. .th FIND I 5/15/74
  2. .sh NAME
  3. find \*- find files
  4. .sh SYNOPSIS
  5. .bd find
  6. pathname expression
  7. .sh DESCRIPTION
  8. .it Find
  9. recursively descends
  10. the directory hierarchy from
  11. .it pathname
  12. seeking files that match a boolean
  13. .it expression
  14. written in the primaries given below.
  15. In the descriptions, the argument
  16. .it n
  17. is used as a decimal integer
  18. where
  19. .it +n
  20. means more than
  21. .it n,
  22. .it \*-n
  23. means less than
  24. .it n
  25. and
  26. .it n
  27. means exactly
  28. .it n.
  29. .s3
  30. .lp +16 16
  31. \fB\*-name\fR filename    True if the
  32. .it filename
  33. argument matches the current file name.
  34. Normal
  35. .it Shell
  36. argument syntax may be used if escaped (watch out for
  37. `[', `?' and `*').
  38. .s3
  39. .lp +16 16
  40. \fB\*-perm\fR onum    \c
  41. True if the file permission flags
  42. exactly
  43. match the
  44. octal number
  45. .it onum
  46. (see chmod(I)).
  47. If
  48. .it onum
  49. is prefixed by a minus sign,
  50. more flag bits (017777, see stat(II)) become significant and
  51. the flags are compared: 
  52. .it "(flags&onum)==onum."
  53. .s3
  54. .lp +16 16
  55. \fB\*-type\fI c\fR    True if the type of the file
  56. is
  57. .it c,
  58. where
  59. .it c
  60. is
  61. .bd "b, c, d"
  62. or
  63. .bd f
  64. for
  65. block special file, character special file,
  66. directory or plain file.
  67. .s3
  68. .lp +16 16
  69. \fB\*-links\fI n\fR    \c
  70. True if the file has
  71. .it n
  72. links.
  73. .s3
  74. .lp +16 16
  75. \fB\*-user\fR uname    \c
  76. True if the file belongs to the user
  77. .it uname.
  78. .s3
  79. .lp +16 16
  80. \fB\*-group\fR gname    \c
  81. As it is for
  82. .bd \*-user
  83. so shall it be for
  84. .bd \*-group
  85. (someday).
  86. .s3
  87. .lp +16 16
  88. \fB\*-size\fI n\fR    \c
  89. True if the file is
  90. .it n
  91. blocks long (512 bytes per block).
  92. .s3
  93. .lp +16 16
  94. \fB\*-atime\fI n\fR    \c
  95. True if the file has been accessed in
  96. .it n
  97. days.
  98. .s3
  99. .lp +16 16
  100. \fB\*-mtime\fI n\fR    \c
  101. True if the file has been modified in
  102. .it n
  103. days.
  104. .s3
  105. .lp +16 16
  106. \fB\*-exec\fR command    \c
  107. True if the executed command returns
  108. exit status zero
  109. (most commands do).
  110. The end of the command is punctuated by an escaped
  111. semicolon.
  112. A command argument `{}' is replaced by the
  113. current pathname.
  114. .s3
  115. .lp +16 16
  116. \fB\*-ok\fR command    \c
  117. Like
  118. .bd \*-exec
  119. except that the generated command line is printed
  120. with a question mark first,
  121. and is executed only if the user responds
  122. \fBy\fR.
  123. .s3
  124. .lp +16 16
  125. \fB\*-print\fR    \c
  126. Always true;
  127. causes the current pathname to be printed.
  128. .s3
  129. .i0
  130. The primaries may be combined with 
  131. these operators
  132. (ordered by precedence):
  133. .s3
  134. .lp +16 16
  135. \fB!\fR    prefix 
  136. .it not
  137. .s3
  138. .lp +16 16
  139. \fB\*-a\fR    infix
  140. .it and,
  141. second operand evaluated only if first is true
  142. .s3
  143. .lp +16 16
  144. \fB\*-o\fR    infix
  145. .it or,
  146. second operand evaluated only if first is false
  147. .s3
  148. .lp +16 16
  149. \fB( \fRexpression\fB )\fR    parentheses for grouping.
  150. (Must be escaped.)
  151. .s3
  152. .i0
  153. To remove files named
  154. `a.out' and `*.o' not accessed for a week:
  155. .s3
  156. .lp +.5i 0
  157. find / "(" \*-name a.out \*-o \*-name "*.o" ")"
  158. \*-a \*-atime +7 \*-a \*-exec rm {} ";"
  159. .i0
  160. .sh FILES
  161. /etc/passwd
  162. .sh "SEE ALSO"
  163. sh (I), if(I), file system (V)
  164. .sh BUGS
  165. There is no way to check device type.
  166. .br
  167. Syntax should be reconciled with
  168. .it if.
  169.