From: Mario Stargard <mstargard@hotmail.com>
Subject: Re: Searching for text in a file
Date: Wed, 30 May 2001 13:22:09 -0400 [thread overview]
Message-ID: <3B152C41.4F4898CA@hotmail.com> (raw)
In-Reply-To: 3s01f9.i9n.ln@momsys.fuller.local
"Stuart R. Fuller" wrote:
>
> Aaron Banks <banks45@yahoo.com> wrote:
> : This may be simple. I want to search for a certain text string in all files
> : on my system. How do I do that?
>
> find / | xargs grep my-string
>
> Stu
You've not guaranteed that grep will get more than one argument and so
won't return the filename in some instances. Also you can really speed
things up by just looking in text files. grepping through binaries,
especially oracle dbf's can be time consuming.
find . -type f |xargs file |awk -F: '$NF ~ /text/{ print $1 }' |xargs
grep my-string /dev/null
Mario
next prev parent reply other threads:[~2001-05-30 17:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <3b13fcaa@nubby2.>
2001-05-29 20:38 ` Searching for text in a file Stuart R. Fuller
2001-05-29 20:38 ` Stuart R. Fuller
2001-05-30 17:22 ` Mario Stargard [this message]
2001-05-30 6:24 ` Michael Heiming
2001-05-29 20:54 Bob Harris
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox