On Thu, Nov 24, 2016 at 04:42:37PM +0100, Senthil Kumar M wrote:
> Hello Tech,
>
> In the find(1) man page, for the option `-f':
>
> -f path
> Specifies a file hierarchy for find to traverse. File
> hierarchies may be specified without the -f option if they are
> given immediately after any other options.
>
> shouldn't this be `before' instead of `after'?
No, look at the synopsis. An option is not the same as an expression.
>
> Also, in the third listed example in EXAMPLES:
>
> Print out a list of all core files on local file systems:
>
> $ find / \! -fstype local -prune -o -name '*.core'
>
> shouldn't this be instead:
> $ find / -fstype local -prune -o -name '*.core'
No, look at the definition of -prune. You want to prevent find to go
into a non-local fs. You version makes the prune active on any local
filesystem. Try it.
-Otto
>
> The following diff incorporates these two changes.
>
> Senthil
>
> Index: find.1
> ===================================================================
> RCS file: /cvs/src/usr.bin/find/find.1,v
> retrieving revision 1.91
> diff -u -p -r1.91 find.1
> --- find.1 11 Sep 2015 18:58:16 -0000 1.91
> +++ find.1 24 Nov 2016 12:17:16 -0000
> @@ -86,7 +86,7 @@ Specifies a file hierarchy for
> to traverse.
> File hierarchies may be specified without the
> .Fl f
> -option if they are given immediately after any other options.
> +option if they are given immediately before any other options.
> .It Fl H
> Causes the file information and file type (see
> .Xr stat 2 )
> @@ -546,7 +546,7 @@ and owned by
> .Pp
> Print out a list of all core files on local file systems:
> .Pp
> -.Dl "$ find / \e! -fstype local -prune -o -name '*.core'"
> +.Dl "$ find / -fstype local -prune -o -name '*.core'"
> .Pp
> Find all files in
> .Pa /usr/src