| Summary: | 'find' man page should | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Documentation | Reporter: | Soren Spies <sspies> | ||||
| Component: | Books & Articles | Assignee: | Tom Rhodes <trhodes> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | Latest | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
You can use this patch, for instance:
--- patch begins here ---
--- src/usr.bin/find/find.1 Tue Aug 27 21:14:08 2002
+++ /home/chris/work/find.1 Tue Sep 10 12:30:20 2002
@@ -738,6 +738,9 @@
.It Li "find . -newerct '1 minute ago' -print"
Print out a list of all the files whose inode change time is more
recent than the current time minus one minute.
+.It Li "find . -type d -exec chmod go-w \e{\e} \e;"
+Deny write permission to group and others on the current directory
+and all its sub-directories.
.El
.Sh SEE ALSO
.Xr chflags 1 ,
--- patch ends here ---
--
chris
Hi there,
I've made some modifications to the patch supplied:
1) I personally feel the example should be something harmless. Users
running the previous example may find themselves in a sticky
situation if they ran the example in the wrong directory not fully
understanding what it does. The example I've submitted is
harmless.
2) An example in the current man page references "." as a starting
point, while all the others use "/". I've changed the example to
also use "/" as it seems more in line with the others.
Cheers,
Marc
Responsible Changed From-To: freebsd-doc->trhodes Take this PR. State Changed From-To: open->patched Patch applied; thanks for the submission! State Changed From-To: patched->closed MFC Complete! |
One common use of 'find' is with the -exec flag. It's rather tricky to get right for the novice (the \; gets most people the first time) and thus would be an excellent flag to document in the find(1) man page's EXAMPLES section. The current man pages (FreeBSD 4.5 and 4.6) don't show the \; and only obliquely refers to the need for special quoting: "Optional arguments may be passed to the utility. The expression must be terminated by a semicolon (``;'')." Fix: add an example to the EXAMPLES section: find . -type d -exec chmod g-w {} \; How-To-Repeat: man find *think* "-exec looks cool" try to use it: find . -type f -exec chmod g-w {} ; find: -exec: no terminating ";" wonder why it failed ... eventually resort to finding someone more knowledgable, general sadness, lack of confidence, etc. :)