From: Neil Bothwick <neil@digimed.co.uk>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] grep -lr ignoring subdirs that start with dot (.)?
Date: Fri, 17 Apr 2015 22:59:27 +0100 [thread overview]
Message-ID: <20150417225927.25380c30@digimed.co.uk> (raw)
In-Reply-To: <553173CD.4090801@libertytrek.org>
[-- Attachment #1: Type: text/plain, Size: 907 bytes --]
On Fri, 17 Apr 2015 16:57:49 -0400, Tanstaafl wrote:
> So, from the target users top level Maildir:
>
> grep -lr <searchstring> * | xargs ls -lt
>
> ^^^ appears to work, and does return results for the cur and new
> subdirs, but seems to be ignoring the rest of the Maildirs. Maybe it has
> something to do with the fact that they start with dots (ie, .Sent,
> .Trash, etc)??
>
> Anyone have any idea why the above doesn't search them all?
The shell expands * to the contents of the current directory, excluding
hidden files. It's not grep's doing it is the shell expansion that is
catching you out.
Since you want to search the entire contents f the current directory,
there is no need to pass grep a list of directories (especially not an
incomplete list), use "grep -lr ."
--
Neil Bothwick
Bug: (n.) any program feature not yet described to the marketing
department.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
next prev parent reply other threads:[~2015-04-17 21:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-17 20:57 [gentoo-user] grep -lr ignoring subdirs that start with dot (.)? Tanstaafl
2015-04-17 21:47 ` Todd Goodman
2015-04-17 22:02 ` covici
2015-04-17 21:59 ` Neil Bothwick [this message]
2015-04-23 11:32 ` Tanstaafl
2015-04-23 14:45 ` Neil Bothwick
2015-04-19 11:12 ` Andreas K. Huettel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150417225927.25380c30@digimed.co.uk \
--to=neil@digimed.co.uk \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox