bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

locate(1) man page hard to understand, please rewrite


From: Dan Jacobson
Subject: locate(1) man page hard to understand, please rewrite
Date: 07 Jul 2002 05:36:57 +0800
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

DESCRIPTION
       This manual page documents the GNU version of locate.  For
       each  given pattern, locate searches one or more databases
       of file names and displays the file names that contain the
       pattern.  Patterns can contain shell-style metacharacters:
       `*', `?', and `[]'.  The metacharacters do not  treat  `/'
       or  `.'   specially.   Therefore,  a pattern `foo*bar' can
       match a file name that contains `foo3/bar', and a  pattern
       `*duck*'   can   match   a   file   name   that   contains
       `lake/.ducky'.   Patterns  that   contain   metacharacters
       should  be  quoted  to  protect them from expansion by the
       shell.

I think it is trying to say that it does an fgrep style search on its database.

       If a pattern is a plain string -- it contains no metachar-
       acters  --  locate displays all file names in the database
       that contain that string anywhere.  If a pattern does con-
       tain  metacharacters, locate only displays file names that
       match the pattern exactly.  

I think it is trying to say that it does an fgrep style search on its database.

                                   As  a  result,  patterns  that
       contain  metacharacters  should  usually begin with a `*',
       and will most often end with one as well.  The  exceptions
       are  patterns  that  are  intended to explicitly match the
       beginning or end of a file name.

You got my head spinning.  Can someone please rewrite this page with
the babytalk I need, or maybe I got too much...  Or maybe it should
have two explanations, one for pros: we do an fgrep style search on
the database, etc. and then also an elaboration for beginners.

Anyway, I wanted to search for any directories called tmp, so I did
$ locate /tmp$ #no good
$ locate /tmp|grep /tmp$ #best I can do I suppose
Anyway, I think the man page is trying to say that it doesn't have any
wildcard matching ability at all?
-- 
http://jidanni.org/ Taiwan(04)25854780



reply via email to

[Prev in Thread] Current Thread [Next in Thread]