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

Re: Help with --regex in locate



On Tuesday, December 03, 2019 08:39:28 AM Brian wrote:
> On Tue 03 Dec 2019 at 08:07:16 -0500, rhkramer@gmail.com wrote:
> > On Tuesday, December 03, 2019 07:16:22 AM Andrei POPESCU wrote:
> > > With 'find' instead of 'locate'.
> > > 
> > >     find dir_with_repos -type d -name .git
> > > 
> > > or
> > > 
> > >     find dir_with_repos -type d -name "*.git"
> > > 
> > > if you also have git bare clones ('-name' expects a shell pattern).
> > 
> > It took me a minute (well, a trial) to realize that dir_with_repos is a
> > metaname (right word?).  I prefer a syntax like:
> > 
> > find <dir_with_repos> -type d -name .git
> 
> I prefer that syntax too but many users (particularly new ones) end up
> typing the angle brackets, which, of course, leads to a failed command.
> A second mail is then needed to clear up the confusion. I've taken to
> doing what Andrei does or giving an instruction as to what to type.

Yes, you're right.  On occasion (when I remember / think about it), I do 
something like this (copied from my other recent reply):

Command:

find <dir_with_repos> -type d -name "*.git"

For example:

find /rhk -type d -name "*.git"

But, I don't always remember.  I wish there was a universal unambiguous way to 
convey that information in one line ;-)

Or maybe dir_to_search would have come across to me better, I sort of had a 
brain f___ when I saw with dir_with_repos, without being familiar with find (I 
almost never use it), my first thought was that it was sort of a file type 
specification.  (Obviously, that is silly, but, there is no accounting for how 
my mind works at times (or doesn't) ;-)


Reply to: