From owner-freebsd-doc Wed Aug 23 0:22:24 2000 Delivered-To: freebsd-doc@freebsd.org Received: from 2711.dynacom.net (2711.dynacom.net [206.107.213.3]) by hub.freebsd.org (Postfix) with ESMTP id B1AFF37B43C; Wed, 23 Aug 2000 00:22:19 -0700 (PDT) Received: from urx.com (dsl1-160.dynacom.net [206.159.132.160]) by 2711.dynacom.net (Build 101 8.9.3/NT-8.9.3) with ESMTP id AAA01325; Wed, 23 Aug 2000 00:22:18 -0700 Message-ID: <39A37BAA.BE29A9E0@urx.com> Date: Wed, 23 Aug 2000 00:22:18 -0700 From: Kent Stewart Reply-To: kstewart@urx.com Organization: Dynacom X-Mailer: Mozilla 4.74 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: Mark Ovens Cc: Ben Smithurst , doc@FreeBSD.ORG Subject: Re: locate(1) manpage References: <20000820130425.B254@parish> <20000820212720.C84036@strontium.scientia.demon.co.uk> <20000822202520.E254@parish> <20000822214151.W20036@strontium.scientia.demon.co.uk> <20000822232609.K254@parish> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Mark Ovens wrote: > > On Tue, Aug 22, 2000 at 09:41:51PM +0100, Ben Smithurst wrote: > > Mark Ovens wrote: > > > > > I understand what you mean, but I think it is more complicated than > > > that. Try > > > > > > # locate "/include/" > > > # locate "*include/" > > > # locate "/include*" > > > > This is explained elsewhere in the manpage. (This is a polite way of saying > > "RTFM" ;-) > > The point of this thread is that the FM is difficult to FU :) I agree 100%. > > > > > As a special case, a pattern containing no globbing characters (``foo'') > > is matched as though it were ``*foo*''. > > Yes, I know, but the suggestion in the previous paragraph is that > ''/'' is somehow special, or at least handled differently. > > I'll trawl through the source again and try to get my head around it. > Maybe its just the wording that's the problem and that it is trying to > say exactly what you said (re ``echo *''). You got me to thinking. Dangerous thing after driving 300km to a volcano, walking around with a camera, and then driving home. Locate has alway slightly irritated me because of the abundance of information. What I wanted was a quick and dirty way of finding the combinations of something like rc?d (rc.d was what I was looking for as an example). Anything else that fit into the "?" was fine too. I found that once I added the ?, I had to add where the wild card info could fit. In this case it was the path to rc.d. I tried locate *rc?d and got what I wanted. The thing is there are 100's of files that fit "locate rc.d", which is really a locate "*rc.d*", and that is what I wanted to get away from. I thought I would have to protect some of it but I didn't. A locate *r?.d found some interesting combo's in addition to rc.d. There were some r[123].d's. A locate *r[123].d just found them. It turned out that I didn't have to protect some of the things I thought I would have to protect. For example, you can "locate 6/include" and find all of the files in X11R6/include. I think the write up for locate is misleading but it could be because I'm tired. Kent > > > > > So "locate /include/" is the same as "locate */include/*" which matches > > "/usr/include/ctype.h", but "/include*" is just treated as "/include*", > > which "/usr/include/ctype.h" doesn't match. > > > > -- > > Ben Smithurst / ben@FreeBSD.org / PGP: 0x99392F7D > > -- > 4.4 - The number of the Beastie > ________________________________________________________________ > 51.44°N FreeBSD - The Power To Serve http://www.freebsd.org > 2.057°W My Webpage http://ukug.uk.freebsd.org/~mark > mailto:marko@freebsd.org http://www.radan.com > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-doc" in the body of the message -- Kent Stewart Richland, WA mailto:kbstew99@hotmail.com http://kstewart.urx.com/kstewart/index.html FreeBSD News http://daily.daemonnews.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message