Home | History | Annotate | Download | only in find
History log of /src/usr.bin/find/find.1
RevisionDateAuthorComments
 1.93  02-Nov-2020  uwe Use \*q to refer to ascii quote to save fontlock from confusion.
 1.92  01-Nov-2020  kim Bump date (for "-not")
 1.91  01-Nov-2020  wiz Properly quote '\;' in example.
 1.90  01-Nov-2020  kim Document the -not operator
 1.89  03-Jul-2017  wiz Remove workaround for ancient HTML generation code.
 1.88  04-Jun-2017  abhinav Fix typo: s/compatability/compatibility/
 1.87  13-Jun-2016  wiz Remove trailing whitespace. Remove unnecessary quotes.
 1.86  13-Jun-2016  pgoyette Add new primaries -asince, -csince, and -since to compare file's
attributes against a user-specified timestamp (rather than the
attributes of a reference file).

Update the parse routines so they have access to the name of the
option being parsed. This enables accurate error reporting for
"aliases" of primaries.

Now that aliases work, introduce some aliases for consistency with
Gnu findutils.
 1.85  12-Jun-2016  pgoyette Use .Ic markup for consistency with the rest of the document
 1.84  12-Jun-2016  pgoyette Further clarification of the treatment of numeric user and group names.
 1.83  12-Jun-2016  dholland Extend the numeric handling for uids with -user to gids with -group, and
document it. Leftover bit of PR 46158.
 1.82  12-Jun-2016  pgoyette Change -{min,max}depth argument name from n to depth so that the
earlier statement concerning n being prefaced by a plus or minus.
(These exceptions to the +/- rule noted by kre@)

While here, fix markup error. .Em for emphasis (stress) rather
than .Ar :)
 1.81  17-May-2014  apb Add an example with find ... -exec sh -c ....
 1.80  08-Feb-2013  wiz branches: 1.80.6;
Add serial commas.
From Bug Hunting.
 1.79  13-Oct-2012  njoly Remove a few unneeded Pp macros.
 1.78  26-Aug-2012  wiz branches: 1.78.2;
- improve spelling;
- improve wording;
- complement list of primaries that prevent `-print' from being
used implicitly;
- bump date.

Patch from Bug Hunting.
 1.77  16-Aug-2012  wiz 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.
 1.76  07-Jul-2012  wiz - Even if it may be obvious, actually explain what ``{}'' means
with ``-exec ... {} +'';
- make wording more consistent;
- bump date.

From Bug Hunting.
 1.75  27-Jun-2012  jdf Small fix: Changed 'Nm .' to 'Nm' (introduced by me before).
 1.74  27-Jun-2012  jdf Various formatting changes:
* Remove superfluous Pp macro (fixes mandoc(1) warning)
* use Xr macro instead of Nm where appropriate
* escape punctuation (so Ic actually 'sees' it) (fixed mandoc(1) warning)
* remove redundant argument to successive Nm macros
* remove double spaces

Patch supplied by Bug Hunting.
 1.73  20-Jun-2012  wiz Improve wording and macro usage; bump date.
From Bug Hunting.
 1.72  22-Mar-2012  wiz Fix whitespace nits. Suggested by Bug Hunting.
 1.71  24-Sep-2011  apb branches: 1.71.2;
Updates to the find(1) man page, based on PR 45381 from Greg Woods,
with additional changes by myself.
 1.70  09-Sep-2010  wiz Fix typos found by Ryo HAYASAKA in PR 43857.
While here, split file systems that grew together.
 1.69  06-Nov-2009  dsl Clarify (hopefully) the description of -remove.
Fixes PR/38987
 1.68  15-Oct-2009  joerg Use -compact + explicit .Pp instead of .sp with negative line length.
 1.67  04-Jan-2009  wiz Fix first part of PR 38987 by Robert Elz:
.Dq needs punctuation quoted to mark it up.

I leave 2) and 3) of that PR open for someone else...
 1.66  19-Jul-2007  daniel branches: 1.66.16;
Add the '-E' option to interpret regexes as extended regexes. While we
are here, fix ordering in usage information by putting '-X' in the proper
place.

Addition of '-E' was discussed on tech-userlevel.
 1.65  08-Mar-2007  wiz Remove macrobreaking whitespace.
 1.64  08-Feb-2007  perry Add a missing "can". Update date.
 1.63  06-Feb-2007  perry Document -rm as an alias for -delete, and document that both -delete
and -rm are extensions.
 1.62  06-Feb-2007  elad Add -delete from FreeBSD.
 1.61  02-Feb-2007  wiz Fix typo.
 1.60  01-Feb-2007  christos document -xdev [from Anon Ymous]
 1.59  07-Oct-2006  apb Document "find ... -exec ... {} +". Also make some other minor updates.

Changes initially supplied by John Hawkinson in PR 20470, but edited by me.

/msg wizd: search for ".sp"
 1.58  07-Oct-2006  apb Add some missing entries in lists, and some serial commas.
Inspired by PR 20470 from John Hawkinson.
 1.57  23-Sep-2006  uebayasi PR32022 - Clarify find(1) syntax documentation about parenthesized expressions
and the -f option (explicit hierarchy specifier). From "Sander Bos, with
credits to Peter Bex".

Bump date.
 1.56  20-Feb-2006  jschauma Add a new primary '-exit n':
This primary causes find to stop traversing the filesystem and
exit immediately if a previous condition was met. If no value is
specified, the exit value will be 0, else n. Note that other
primaries will be evaluated and acted upon before exiting.

Ok matt@, garbled@.
 1.55  09-Nov-2005  reed Add -false switch. From man page:

-false This primary always evaluates to false. This can be used follow-
ing a primary that caused the expression to be true to make the
expression to be false. This can be useful after using a -fprint
primary so it can continue to the next expression (using an -or
operator, for example).

This was brought up on the tech-userlevel list in October.

Using -fprint on findutils or new NetBSD find(1) does not do what
I wanted. For example, if saving results of all files that start
with a vowel or saving results of all files owned by group operator,
then the list of files owned by group operator would not include
the files starting with a vowel.

findutils's find has a workaround for this with -false and also a
"," comma opeator. (I made add this comma operator later; you can use
the comma to perform multiple independent tests.)
 1.54  12-Oct-2005  wiz Bump date for previous.
 1.53  12-Oct-2005  reed This adds -fprint function. The primary name "-fprint" (but not the
code) comes from findutils; it behaves the same.

From my manpage addition:

-fprint filename
This primary always evaluates to true. This creates filename or
overwrites the file if it already exists. The file is created at
startup. It writes the pathname of the current file to this
file, followed by a newline character. The file will be empty if
no files are matched.

Here is an example usage:

find /etc \( -name "*pass*" -fprint file1 \) -o \( -group operator -fprint file2 \) -o -name "w*"

Note that this example will NOT include entry in file2 if it is
matched in first expression. (This also is same behaviour as
findutils, and I have implemented a -false primary to handle that.
I will commit it later.)

This creates the file as command line argument parsing time.
If there is an error somewhere on that line, such as missing values
or mismatched parenthesis, then a file may still be created.
(Even if a later -fprint filename is unwritable.) This is similar
behaviour to findutils. (It has been suggested that this find could
be code to create the files in an extra stage after the command-line
argument parsing and before the actual function processing.)

I will add -fprintx and -fprint0 soon.

This was discussed on tech-userlevel.
 1.52  10-Aug-2005  mrg add a "file" to the arguments that isn't enclosed in square brackets
making it clear that at least one file/directory argument is required
in both the manual and usage. "find" with no args currently barfs but
these documents implied it would do something useful.
 1.51  19-Apr-2004  lukem tweak roff in previous
 1.50  19-Apr-2004  lukem Use "sysctl vfs.generic.fstypes" to determine the list of available fstypes.
 1.49  31-Mar-2004  wiz Bump date for previous, and sort a bit.
 1.48  30-Mar-2004  heas Mention -type w, which is coded as a synonym for W (whitespace).
 1.47  07-Aug-2003  agc branches: 1.47.2;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.46  03-Aug-2003  provos Implement -iname for case insensitive matching on file names.
From freebsd/openbsd. Approved by jaromir@, manu@, perry@.
 1.45  26-Jun-2003  wiz Change macro usage so it works correctly with 1.19.
 1.44  04-Apr-2003  wiz Add missing "to be". From Jim Bernard in PR 21008.
 1.43  25-Feb-2003  wiz .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
 1.42  23-Feb-2003  jhawk markup: the ";" for -exec, -ok, and -execdir is a seperate word from
the last argument
 1.41  30-Jan-2003  jhawk Obey preceding - and + on -user when a numeric uid is specified (only).
Our behavior is now consistent with Solaris, and more useful than previous.
 1.40  26-Jan-2003  matt With -printx also qoute $ and ` (since they are shell metacharaters).
 1.39  01-Oct-2002  wiz Lose a trailing space.
 1.38  28-Sep-2002  wiz Clean up after recent changes.
Some notes:
\- is for minus signs only.
Closing braces and punctuation after a macro should definitly not be
on the next line, but at the end of the macro line, separated with spaces
from the macro argument and each other. Otherwise, unwanted whitespace
appears.
 1.37  28-Sep-2002  grant bump date for latest changes.
 1.36  27-Sep-2002  grant New sentence, new line and minor mdoc cleanup.
 1.35  27-Sep-2002  provos support for -empty, -execdir, -mindepth, -maxdepth to match other UNIX-like
systems. based on work by tholo@openbsd.org. approved by perry.
 1.34  16-Sep-2002  thorpej -path is an extension -- say so.
 1.33  08-Feb-2002  ross branches: 1.33.2;
Generate <>& symbolically. I'm avoiding .../dist/... directories for now.
 1.32  02-Dec-2001  kleink Since we've already been down that road with -cnewer, support GNU find(1)'s
-anewer as well.
 1.31  01-Dec-2001  wiz Punctuation fix, sort SEE ALSO, sort sections, drop a .Pp.
 1.30  01-Dec-2001  wiz Whitespace cleanup.
 1.29  01-Dec-2001  kleink Add a "cnewer" primary which evaluates true if a file has a more recent
ctime than its argument.

From kre in PR bin/14802; originally suggested name was "updated" but
renamed due to GNU find(1) being prior art for this functionality.
 1.28  06-Jul-2001  abs space after section number in .Xr
 1.27  11-Jul-2000  kleink -s: Replace the reference to strcmp(3) with a functional description.
 1.26  16-Mar-2000  enami Fix typo.
 1.25  13-Mar-2000  itohy Add -s in usage.
 1.24  10-Mar-2000  itohy Describe -s (sort) option.
Corrections are highly appreciated.
 1.23  20-Jul-1999  kleink Mention -iregex and -regex primaries being non-standard extensions.
 1.22  20-Jul-1999  cgd add -regex and -iregex primaries which, like GNU find's primaries of the
same name, match files' entire paths against regular expressions.
-regex is case sensitive, -iregex is case-insensitive. Note that these
primaries are _not_ entirely compatible with the GNU find primaries,
because their BREs appear to support alternation with \| whereas our BREs
do not. Also note there are no primaries which provide extended regular
expressions matching, though if they are desired they would be trivial
to implement.
 1.21  30-Apr-1999  simonb Add '-h' to synopsis - from Nathan Williams.
 1.20  07-Mar-1999  mycroft branches: 1.20.2;
Fix minor formatting error.
 1.19  19-Jan-1999  simonb Add -{a,c,m}min to STANDARDS section (via Klaus Klein)
 1.18  16-Jan-1999  simonb Add GNU-style -{a,c,m}min primaries.
 1.17  12-Jan-1999  lukem Add support for -printx, which quotes pathnames in an xargs friendly way.
From [bin/6790] by Eric Fischer <eric@fudge.uchicago.edu>
 1.16  03-Jan-1999  lukem Add support for "-flags [-]flags", which matches the file flags in a
similar way that "-perm [-]mode" matches the file mode.
 1.15  03-Jan-1999  lukem args to -perm are "-perm [-]mode" not "-perm [-mode]"
 1.14  27-May-1998  msaitoh eliminate a duplicated -X entry
 1.13  02-Feb-1998  mrg merge lite2, sans getvfsbyname in functions.c (waiting on libc)
 1.12  19-Oct-1997  lukem fix .Nm usage, deprecate register, mostly WARNSify (needs minor rewrite to fix)
 1.11  09-Jan-1997  tls RCS ID police
 1.10  21-May-1996  mrg add support for whiteouts. pr#2394 (Mike Long <mike.long@analog.com>)
 1.9  14-Jan-1996  thorpej Document the -follow option, per David Brownlee <abs@mono.city.ac.uk>
in PR #1113.
 1.8  18-Jul-1994  cgd fix behaviour when adding -print
 1.7  14-Apr-1994  cgd branches: 1.7.2;
fstypes will be strings soon
 1.6  30-Dec-1993  jtc Merged our bugfixes with the 4.4BSD find from uunet.
 1.5  29-Dec-1993  jtc Update the list of primaries that are extensions of POSIX.2.
 1.4  27-Oct-1993  jtc Added -print0 (like GNU find). This will allow file names that contain
newlines to be correctly interpreted by programs that process find
output.
 1.3  01-Aug-1993  mycroft Add RCS indentifiers.
 1.2  24-Mar-1993  cgd added support for "kernfs" and "fdesc" to -fstype
 1.1  21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2  01-Sep-1995  jtc imported from 44lite2
 1.1.1.1  21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.7.2.1  18-Jul-1994  cgd udpated from trhunk; needed fro release building scripts
 1.20.2.2  20-Aug-1999  cgd pull up revs 1.22-1.23 from trunk. (cgd)
 1.20.2.1  30-Apr-1999  perry pullup 1.20->1.21 (simonb)
 1.33.2.1  01-Dec-2002  he Pull up revision 1.34 (requested by thorpej in ticket #838):
-path is an extension, so document it as such.
 1.47.2.1  31-Mar-2004  tron branches: 1.47.2.1.2;
Pull up revision 1.48 (requested by heas in ticket #25):
Mention -type w, which is coded as a synonym for W (whitespace).
 1.47.2.1.2.2  11-Oct-2005  reed Revert changes. I accidently committed to netbsd-2.
 1.47.2.1.2.1  11-Oct-2005  reed This adds -fprint function. The primary name "-fprint" (but not the
code) comes from findutils; it behaves the same.

From my manpage addition:

-fprint filename
This primary always evaluates to true. This creates filename or
overwrites the file if it already exists. The file is created at
startup. It writes the pathname of the current file to this
file, followed by a newline character. The file will be empty if
no files are matched.

Here is an example usage:

find /etc \( -name "*pass*" -fprint file1 \) -o \( -group operator -fprint file2 \) -o -name "w*"

This was discussed on tech-userlevel.

This creates the file as command line argument parsing time.
If there is an error somewhere on that line, such as missing values
or mismatched parenthesis, then a file may still be created.
(Even if a later -fprint filename is unwritable.) This is similar
behaviour to findutils. (It has been suggested that this find could
be code to create the files in an extra stage after the command-line
argument parsing and before the actual function processing.)

I will add -fprintx and -fprint0 soon.
 1.66.16.2  19-Jul-2007  daniel Add the '-E' option to interpret regexes as extended regexes. While we
are here, fix ordering in usage information by putting '-X' in the proper
place.

Addition of '-E' was discussed on tech-userlevel.
 1.66.16.1  19-Jul-2007  daniel file find.1 was added on branch matt-mips64 on 2007-07-19 07:49:31 +0000
 1.71.2.3  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.71.2.2  30-Oct-2012  yamt sync with head
 1.71.2.1  17-Apr-2012  yamt sync with head
 1.78.2.3  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.78.2.2  25-Feb-2013  tls resync with head
 1.78.2.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.80.6.1  10-Aug-2014  tls Rebase.

RSS XML Feed