Gentoo Archives: gentoo-user

From: covici@××××××××××.com
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] grep -lr ignoring subdirs that start with dot (.)?
Date: Fri, 17 Apr 2015 22:02:57
Message-Id: 5594.1429308167@ccs.covici.com
In Reply to: Re: [gentoo-user] grep -lr ignoring subdirs that start with dot (.)? by Todd Goodman
1 Todd Goodman <tsg@×××××××××.net> wrote:
2
3 > * Tanstaafl <tanstaafl@×××××××××××.org> [150417 16:58]:
4 > > Hi all,
5 > >
6 > > Ok, this is driving me crazy...
7 > >
8 > > I want to be able to quickly search an entire users Maildir for an email
9 > > containing a certain string, but output just the filenames WITH THE
10 > > DATE/TIMEs...
11 > >
12 > > So, from the target users top level Maildir:
13 > >
14 > > grep -lr <searchstring> * | xargs ls -lt
15 > >
16 > > ^^^ appears to work, and does return results for the cur and new
17 > > subdirs, but seems to be ignoring the rest of the Maildirs. Maybe it has
18 > > something to do with the fact that they start with dots (ie, .Sent,
19 > > .Trash, etc)??
20 > >
21 > > Anyone have any idea why the above doesn't search them all?
22 > >
23 > > Thanks
24 >
25 > Try?
26 >
27 > grep -lr <searchstring> * | xargs ls -lta
28 >
29 > Maybe?
30
31 Better use the find command with -exec grep and its arguments. You
32 will probably need -H if you want to know the filename. The difference
33 is that find only ignores . and .., but does go over other things
34 beginning with .
35
36 --
37 Your life is like a penny. You're going to lose it. The question is:
38 How do
39 you spend it?
40
41 John Covici
42 covici@××××××××××.com