Finally make mesg do the right thing (this was driving me crazy!)
[unix-history] / usr.bin / find / find.1
index 2f900b3..49d4d7a 100644 (file)
@@ -1,5 +1,5 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
-.\" All rights reserved.
+.\" Copyright (c) 1990, 1993
+.\"    The Regents of the University of California.  All rights reserved.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" the Institute of Electrical and Electronics Engineers, Inc.
 .\"
 .\" This code is derived from software contributed to Berkeley by
 .\" the Institute of Electrical and Electronics Engineers, Inc.
@@ -32,9 +32,9 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\"    @(#)find.1      6.30 (Berkeley) 2/27/92
+.\"    @(#)find.1      8.1 (Berkeley) 6/6/93
 .\"
 .\"
-.Dd February 27, 1992
+.Dd June 6, 1993
 .Dt FIND 1
 .Os
 .Sh NAME
 .Dt FIND 1
 .Os
 .Sh NAME
@@ -42,7 +42,7 @@
 .Nd walk a file hierarchy
 .Sh SYNOPSIS
 .Nm find
 .Nd walk a file hierarchy
 .Sh SYNOPSIS
 .Nm find
-.Op Fl dsXx
+.Op Fl HdhXx
 .Op Fl f Ar file
 .Op Ar file ...
 .Ar expression
 .Op Fl f Ar file
 .Op Ar file ...
 .Ar expression
@@ -55,14 +55,19 @@ listed, evaluating an
 (composed of the ``primaries'' and ``operands'' listed below) in terms
 of each file in the tree.
 .Pp
 (composed of the ``primaries'' and ``operands'' listed below) in terms
 of each file in the tree.
 .Pp
-If
-.Ar file
-is a symbolic link referencing an existing file, the directory tree
-referenced by the link is descended instead of the link itself.
-.Pp
 The options are as follows:
 .Pp
 .Bl -tag -width Ds
 The options are as follows:
 .Pp
 .Bl -tag -width Ds
+.It Fl H
+The
+.Fl H
+option causes the file information and file type (see
+.Xr stat  2  ) ,
+returned for each symbolic link encountered on the command line to be 
+those of the file referenced by the link, not the link itself.
+If the referenced file does not exist, the file information and type will
+be for the link itself.  File information of all symbolic links not on 
+the command line is that of the link itself.
 .It Fl d
 The
 .Fl d
 .It Fl d
 The
 .Fl d
@@ -85,9 +90,9 @@ option specifies a file hierarchy for
 to traverse.
 File hierarchies may also be specified as the operands immediately
 following the options.
 to traverse.
 File hierarchies may also be specified as the operands immediately
 following the options.
-.It Fl s
+.It Fl h
 The
 The
-.Fl s
+.Fl h
 option causes the file information and file type (see
 .Xr stat  2  ) ,
 returned for each symbolic link to be those of the file referenced by the
 option causes the file information and file type (see
 .Xr stat  2  ) ,
 returned for each symbolic link to be those of the file referenced by the
@@ -145,7 +150,7 @@ was executed.
 .It Ic -fstype Ar type 
 True if the file is contained in a file system of type
 .Ar type .
 .It Ic -fstype Ar type 
 True if the file is contained in a file system of type
 .Ar type .
-Currently supported types are ``local'', ``mfs'', ``nfs'', ``pc'',
+Currently supported types are ``isofs'', ``local'', ``mfs'', ``nfs'', ``pc'',
 ``rdonly'' and ``ufs''.
 The types ``local'' and ``rdonly'' are not specific file system types.
 The former matches any file system physically mounted on the system where
 ``rdonly'' and ``ufs''.
 The types ``local'' and ``rdonly'' are not specific file system types.
 The former matches any file system physically mounted on the system where
@@ -184,19 +189,6 @@ True if the difference between the file last modification time and the time
 was started, rounded up to the next full 24\-hour period, is
 .Ar n
 24\-hour periods.
 was started, rounded up to the next full 24\-hour period, is
 .Ar n
 24\-hour periods.
-.It Ic \&-ok Ar utility Ns Op argument ... ; 
-The
-.Ic \&-ok
-primary is identical to the
-.Ic -exec
-primary with the exception that
-.Nm find
-requests user affirmation for the execution of the utility by printing
-a message to the terminal and reading a response.
-If the response is other than ``y'' the command is not executed and the
-value of the
-.Ar \&ok
-expression is false.
 .It Ic -name Ar pattern 
 True if the last component of the pathname being examined matches
 .Ar pattern  .
 .It Ic -name Ar pattern 
 True if the last component of the pathname being examined matches
 .Ar pattern  .
@@ -212,6 +204,19 @@ True if the current file has a more recent last modification time than
 True if the file belongs to an unknown user.
 .It Ic -nogroup
 True if the file belongs to an unknown group.
 True if the file belongs to an unknown user.
 .It Ic -nogroup
 True if the file belongs to an unknown group.
+.It Ic \&-ok Ar utility Ns Op argument ... ; 
+The
+.Ic \&-ok
+primary is identical to the
+.Ic -exec
+primary with the exception that
+.Nm find
+requests user affirmation for the execution of the utility by printing
+a message to the terminal and reading a response.
+If the response is other than ``y'' the command is not executed and the
+value of the
+.Ar \&ok
+expression is false.
 .It Ic -path Ar pattern 
 True if the pathname being examined matches
 .Ar pattern  .
 .It Ic -path Ar pattern 
 True if the pathname being examined matches
 .Ar pattern  .
@@ -253,12 +258,28 @@ Note, the first character of a symbolic mode may not be a dash (``\-'').
 .It Ic -print
 This primary always evaluates to true.
 It prints the pathname of the current file to standard output.
 .It Ic -print
 This primary always evaluates to true.
 It prints the pathname of the current file to standard output.
-The expression is appended to the user specified expression if neither
+The expression is appended to the user specified expression if none of
 .Ic -exec ,
 .Ic -exec ,
-.Ic -ls
-or
+.Ic -ls ,
+.Ic -print0 ,
+.Ic -printf
+and
 .Ic \&-ok
 .Ic \&-ok
-is specified.
+are specified.
+.It Ic -print0
+This primary prints the pathname of the current file to standard output,
+followed by a NUL (ASCII 0) character.  No newline is output.  It
+is intended for use when the files being reported may contain newlines or
+other special characters.
+.It Ic -printf
+This primary takes one argument, which is interpreted as a format string
+to be passed to 
+.Xr printf 3 .
+It must contain exactly one 
+.Dq Li \&%s
+format specifier, with or without modifier flags, which receives the
+full pathname of the current file.  No C-style escape processing is
+performed.
 .It Ic -prune
 This primary always evaluates to true.
 It causes
 .It Ic -prune
 This primary always evaluates to true.
 It causes
@@ -370,15 +391,23 @@ and owned by ``wnj''.
 .It Li "find  /  \e(  -newer  ttt  -or  -user wnj  \e)  -print"
 Print out a list of all the files that are either owned by ``wnj'' or
 that are newer than ``ttt''.
 .It Li "find  /  \e(  -newer  ttt  -or  -user wnj  \e)  -print"
 Print out a list of all the files that are either owned by ``wnj'' or
 that are newer than ``ttt''.
+.It Li "find / -name \e*~ -print0 | perl -n0e unlink"
+Find all the
+.Xr emacs 1
+backup files and delete them quickly using
+.Xr perl 1 .
 .El
 .Sh SEE ALSO
 .Xr chmod 1 ,
 .Xr locate 1 ,
 .El
 .Sh SEE ALSO
 .Xr chmod 1 ,
 .Xr locate 1 ,
-.Xr test 1 ,
+.Xr xargs 1 ,
 .Xr stat 2 ,
 .Xr stat 2 ,
+.Xr fts 3 ,
 .Xr getpwent 3 ,
 .Xr getgrent 3 ,
 .Xr getpwent 3 ,
 .Xr getgrent 3 ,
-.Xr strmode 3
+.Xr printf 3 ,
+.Xr strmode 3 ,
+.Xr symlink 7
 .Sh STANDARDS
 The
 .Nm find
 .Sh STANDARDS
 The
 .Nm find
@@ -391,9 +420,11 @@ The
 and
 .Fl X
 options and the
 and
 .Fl X
 options and the
-.Ic -inum
+.Ic -inum ,
+.Ic -ls ,
+.Ic -print0 ,
 and
 and
-.Ic -ls
+.Ic -printf
 primaries are extensions to
 .St -p1003.2 .
 .Pp
 primaries are extensions to
 .St -p1003.2 .
 .Pp