Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/find Various improvements:
details: https://anonhg.NetBSD.org/src/rev/dad71669f9a5
branches: trunk
changeset: 781051:dad71669f9a5
user: wiz <wiz%NetBSD.org@localhost>
date: Thu Aug 16 13:34:10 2012 +0000
description:
Various improvements:
- remove redundant mentioning of option names within their description;
- improve (and make consistent) punctuation;
- add missing empty line;
- remove superfluous white space;
- extend `-iname' primary description (copying text from `-name');
- general wording improvements;
- improve macro usage;
- remove double spaces from examples (it's readable well without);
- reference re_format(7) in `SEE ALSO' (as it's mentioned in the
text several times);
- bump date.
>From Bug Hunting.
diffstat:
usr.bin/find/find.1 | 117 +++++++++++++++++++++++++--------------------------
1 files changed, 57 insertions(+), 60 deletions(-)
diffs (truncated from 329 to 300 lines):
diff -r 0d92c0dffe6d -r dad71669f9a5 usr.bin/find/find.1
--- a/usr.bin/find/find.1 Thu Aug 16 13:31:24 2012 +0000
+++ b/usr.bin/find/find.1 Thu Aug 16 13:34:10 2012 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: find.1,v 1.76 2012/07/07 20:45:09 wiz Exp $
+.\" $NetBSD: find.1,v 1.77 2012/08/16 13:34:10 wiz Exp $
.\"
.\" Copyright (c) 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -32,7 +32,7 @@
.\"
.\" from: @(#)find.1 8.7 (Berkeley) 5/9/95
.\"
-.Dd July 7, 2012
+.Dd August 16, 2012
.Dt FIND 1
.Os
.Sh NAME
@@ -67,10 +67,8 @@
The options are as follows:
.Bl -tag -width Ds
.It Fl H
-The
-.Fl H
-option causes the file information and file type (see
-.Xr stat 2 ) ,
+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
@@ -78,27 +76,21 @@
File information of all symbolic links not on the command line is that
of the link itself.
.It Fl L
-The
-.Fl L
-option causes the file information and file type (see
+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
link, not the link itself.
If the referenced file does not exist, the file information and type will
be for the link itself.
.It Fl P
-The
-.Fl P
-option causes the file information and file type (see
+Causes the file information and file type (see
.Xr stat 2 )
returned for each symbolic link to be those of the link itself.
.It Fl d
-The
-.Fl d
-option causes
+Causes
.Nm
to perform a depth-first traversal, i.e., directories
-are visited in post-order and all entries in a directory will be acted
+are visited in post-order, and all entries in a directory will be acted
on before the directory itself.
By default,
.Nm
@@ -107,34 +99,26 @@
.Ar not
a breadth-first traversal.
.It Fl E
-The
-.Fl E
-option causes
+Causes
.Ar regexp
arguments to primaries to be interpreted as extended regular
expressions (see
.Xr re_format 7 ) .
.It Fl f
-The
-.Fl f
-option specifies a file hierarchy for
+Specifies a file hierarchy for
.Nm
to traverse.
File hierarchies may also be specified as the operands immediately
following the options.
.It Fl h
-The
-.Fl h
-option causes the file information and file type (see
-.Xr stat 2 ) ,
+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
link, not the link itself.
If the referenced file does not exist, the file information and type will
be for the link itself.
.It Fl s
-The
-.Fl s
-option causes the entries of each directory to be sorted in
+Causes the entries of each directory to be sorted in
lexicographical order.
Note that the sorting is done only inside of each directory;
files in different directories are not sorted.
@@ -146,9 +130,7 @@
.Dq Li "find ... \&| sort"
order.
.It Fl X
-The
-.Fl X
-option is a modification to permit
+Modifies the output to permit
.Nm
to be safely used in conjunction with
.Xr xargs 1 .
@@ -171,9 +153,7 @@
.Xr xargs 1
can accept.
.It Fl x
-The
-.Fl x
-option restricts the search to the file system containing the
+Restricts the search to the file system containing the
directory specified.
Does not list mount points to other file systems.
.El
@@ -190,6 +170,7 @@
.Dq less than Ar n ,
and neither means
.Dq exactly Ar n .
+.Pp
.Bl -tag -width Ds -compact
.It Ic -amin Ar n
True if the difference between the file last access time and the time
@@ -200,7 +181,7 @@
.Pp
.It Ic -anewer Ar file
True if the current file has a more recent last access time than
-.Ar file .
+.Ar file .
.Pp
.It Ic -atime Ar n
True if the difference between the file last access time and the time
@@ -219,7 +200,7 @@
.Pp
.It Ic -cnewer Ar file
True if the current file has a more recent last change time than
-.Ar file .
+.Ar file .
.Pp
.It Ic -ctime Ar n
True if the difference between the time of last change of file status
@@ -420,7 +401,7 @@
.Pp
.It Ic -group Ar gname
True if the file belongs to the group
-.Ar gname .
+.Ar gname .
If
.Ar gname
is numeric and there is no such group name, then
@@ -428,14 +409,26 @@
is treated as a group id.
.Pp
.It Ic -iname Ar pattern
-True if the last component of the pathname being examined
-matches
+True if the last component of the pathname being examined matches
+.Ar pattern
+in a case-insensitive manner.
+Special shell pattern matching characters
+.Po
+.Dq \&[ ,
+.Dq \&] ,
+.Dq \&* ,
+and
+.Dq \&?
+.Pc
+may be used as part of
.Ar pattern .
-Case insensitive.
+These characters may be matched explicitly by escaping them with a
+backslash
+.Pq Dq \e .
.Pp
.It Ic -inum Ar n
True if the file has inode number
-.Ar n .
+.Ar n .
.Pp
.It Ic -iregex Ar regexp
True if the path name of the current file matches the case-insensitive
@@ -513,23 +506,24 @@
.Pp
.It Ic -name Ar pattern
True if the last component of the pathname being examined matches
-.Ar pattern .
+.Ar pattern .
Special shell pattern matching characters
.Po
.Dq \&[ ,
.Dq \&] ,
.Dq \&* ,
+and
.Dq \&?
.Pc
may be used as part of
-.Ar pattern .
+.Ar pattern .
These characters may be matched explicitly by escaping them with a
backslash
.Pq Dq \e .
.Pp
.It Ic -newer Ar file
True if the current file has a more recent last modification time than
-.Ar file .
+.Ar file .
.Pp
.It Ic -nouser
True if the file belongs to an unknown user.
@@ -539,7 +533,7 @@
.Pp
.It Ic -path Ar pattern
True if the pathname being examined matches
-.Ar pattern .
+.Ar pattern .
Special shell pattern matching characters
.Po
.Dq \&[ ,
@@ -549,7 +543,7 @@
.Dq \&?
.Pc
may be used as part of
-.Ar pattern .
+.Ar pattern .
These characters may be matched explicitly by escaping them with a
backslash
.Pq Dq \e .
@@ -642,7 +636,7 @@
.Pp
.It Ic -size Ar n Ns Op Cm c
True if the file's size, rounded up, in 512-byte blocks is
-.Ar n .
+.Ar n .
If
.Ar n
is followed by a
@@ -678,7 +672,7 @@
.Pp
.It Ic -user Ar uname
True if the file belongs to the user
-.Ar uname .
+.Ar uname .
If
.Ar uname
is numeric and there is no such user name, then
@@ -688,7 +682,9 @@
.It Ic -xdev
This primary always evaluates to true.
It causes find not to descend past directories that have a different
-device ID (st_dev, see
+device ID
+.Va ( st_dev ,
+see
.Xr stat 2
S5.6.2 [POSIX.1]).
.El
@@ -747,44 +743,44 @@
.Sh EXAMPLES
The following examples are shown as given to the shell:
.Bl -tag -width findx
-.It Li "find / \e! -name \*q*.c\*q \-print"
+.It Li "find / \e! -name \*q*.c\*q \-print"
Print out a list of all the files whose names do not end in
.Dq \&.c .
-.It Li "find / \-newer ttt \-user wnj \-print"
+.It Li "find / \-newer ttt \-user wnj \-print"
Print out a list of all the files owned by user
.Dq wnj
that are newer than the file
.Dq ttt .
-.It Li "find . \-type f \-mmin \-30 \-print \-or \-mindepth 1 \-prune"
+.It Li "find . \-type f \-mmin \-30 \-print \-or \-mindepth 1 \-prune"
Print out a list of all the files in the current directory that are
newer than 30 minutes.
-.It Li "find . \-type f \-atime +10 \-mindepth 2 \-print"
+.It Li "find . \-type f \-atime +10 \-mindepth 2 \-print"
Print out a list of all the files in any sub-directories that have not
been accessed in the past ten days.
-.It Li "find . \-mtime +90 \-exec rm \-i {} + \-or \-mindepth 1 \-prune"
+.It Li "find . \-mtime +90 \-exec rm \-i {} + \-or \-mindepth 1 \-prune"
Interactively remove all of the files in the current directory that have
not been modified in 90 days.
-.It Li "find . \-type f \-mtime +90 \-ok mv {} {}.old \e;"
+.It Li "find . \-type f \-mtime +90 \-ok mv {} {}.old \e;"
Interactively rename all of the files in the current directory and all
sub-directories that have not been modified in 90 days.
-.It Li "find / \e! \e( \-newer ttt \-user wnj \e) \-print"
+.It Li "find / \e! \e( \-newer ttt \-user wnj \e) \-print"
Print out a list of all the files which are not both newer than
.Dq ttt
Home |
Main Index |
Thread Index |
Old Index