Bug 173265

Summary: improving <a|c|m>min option description for find(1)
Product: Documentation Reporter: Anton Shterenlikht <as>
Component: Books & ArticlesAssignee: Eitan Adler <eadler>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Anton Shterenlikht 2012-11-01 15:20:00 UTC
find(1) man page has:

     -amin n
             True if the difference between the file last access time and the
             time find was started, rounded up to the next full minute, is n
             minutes.

     -cmin n
             True if the difference between the time of last change of file
             status information and the time find was started, rounded up to
             the next full minute, is n minutes.

     -mmin n
             True if the difference between the file last modification time
             and the time find was started, rounded up to the next full
             minute, is n minutes.

The description is not clear enough.
It is not clear that n can be +n, -n or
just n, and that the meaning will change.

In "UNIX in a nutshell" by Arnold Robbins, 4th edition, 2006,
pages 87-88, there is, in my opinion, a more clear description:

*quote*
-amin +n | -n | n
	Find files last accessed more than n (+n),
	less that n (-n), or exactly n minutes ago.

-cmin +n | -n | n
	Find files last changed more than n (+n),
	less that n (-n), or exactly n minutes ago.

-mmin +n | -n | n
	Find files last modified more than n (+n),
	less that n (-n), or exactly n minutes ago.
*end quote*

Does anybody agree/disagree with me?

Fix: 

I'll provide a patch if there is agreement.
Comment 1 Glen Barber freebsd_committer freebsd_triage 2012-11-02 02:32:36 UTC
On Thu, Nov 01, 2012 at 03:10:50PM +0000, Anton Shterenlikht wrote:
> I'll provide a patch if there is agreement.

I think this looks sane.  If you could provide a patch, that would be
great.

Glen
Comment 2 Anton Shterenlikht 2012-11-02 12:41:10 UTC
See the patch below.
It seems the find(1) man page
favours arguments of the form -cmin [-|+]n
over -cmin -n | +n | n.
So I made my patch accordingly.
With the patch the page now renders as:

     -amin [-|+]n
             Find files last accessed more than n (+n), less than n (-n), or
             exactly n minutes ago.
     -cmin [-|+]n
             Find files last changed more than n (+n), less than n (-n), or
             exactly n minutes ago.
     -mmin [-|+]n
             Find files last modified more than n (+n), less than n (-n), or
             exactly n minutes ago.

Anton

 
Index: usr.bin/find/find.1
===================================================================
--- usr.bin/find/find.1	(revision 238585)
+++ usr.bin/find/find.1	(working copy)
@@ -203,12 +203,16 @@
 See
 .Xr acl 3
 for more information.
-.It Ic -amin Ar n
-True if the difference between the file last access time and the time
-.Nm
-was started, rounded up to the next full minute, is
+.It Ic -amin Oo Cm - Ns | Ns Cm + Oc Ns Ar n
+Find files last accessed more than
 .Ar n
-minutes.
+.Pq + Ns Ar n ,
+less than
+.Ar n
+.Pq - Ns Ar n ,
+or exactly
+.Ar n
+minutes ago.
 .It Ic -anewer Ar file
 Same as
 .Ic -neweram .
@@ -250,13 +254,16 @@
 or
 .Cm -
 modifier.
-.It Ic -cmin Ar n
-True if the difference between the time of last change of file status
-information and the time
-.Nm
-was started, rounded up to the next full minute, is
+.It Ic -cmin Oo Cm - Ns | Ns Cm + Oc Ns Ar n
+Find files last changed more than
 .Ar n
-minutes.
+.Pq + Ns Ar n ,
+less than
+.Ar n
+.Pq - Ns Ar n ,
+or exactly
+.Ar n
+minutes ago.
 .It Ic -cnewer Ar file
 Same as
 .Ic -newercm .
@@ -538,12 +545,16 @@
 not normally be evaluated.
 .Dq Ic -mindepth Li 1
 processes all but the command line arguments.
-.It Ic -mmin Ar n
-True if the difference between the file last modification time and the time
-.Nm
-was started, rounded up to the next full minute, is
+.It Ic -mmin Oo Cm - Ns | Ns Cm + Oc Ns Ar n
+Find files last modified more than
 .Ar n
-minutes.
+.Pq + Ns Ar n ,
+less than
+.Ar n
+.Pq - Ns Ar n ,
+or exactly
+.Ar n
+minutes ago.
 .It Ic -mnewer Ar file
 Same as
 .Ic -newer .
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2012-11-02 15:06:03 UTC
Responsible Changed
From-To: freebsd-doc->eadler

I'll take it.
Comment 4 Eitan Adler freebsd_committer freebsd_triage 2012-11-02 15:23:51 UTC
State Changed
From-To: open->analyzed

awaiting approval or review prior to commit (no action needed from 
submitter)  note that I opted to only take part of the patch; in 
particular I kept the language 'True if the difference between the file 
last access time and the time...'
Comment 5 Eitan Adler freebsd_committer freebsd_triage 2012-11-19 13:11:00 UTC
State Changed
From-To: analyzed->patched

committed in r243239
Comment 6 Eitan Adler freebsd_committer freebsd_triage 2013-02-04 00:31:18 UTC
State Changed
From-To: patched->closed

due to merge conflicts I shall not be MFCing this