Any reason this is off list? List cc:'ed in response.
on Mon, Oct 30, 2000 at 04:24:36AM -0900, Ethan Benson ([EMAIL PROTECTED])
wrote:
> On Mon, Oct 30, 2000 at 03:16:32AM -0800, kmself@ix.netcom.com wrote:
> > I prefer:
> >
> > $ find . -type f -print0 | xargs --null zgrep -l pattern
> >
on Sun, Oct 29, 2000 at 12:36:17PM -0800, Erik Steffl ([EMAIL PROTECTED]) wrote:
> or slightly more effective:
>
> find . -type f |xargs grep char_string /dev/null
I prefer:
$ find . -type f -print0 | xargs --null zgrep -l pattern
...though as noted, the "grep -r" construct is simpler
on Sun, Oct 29, 2000 at 11:39:04PM +, sena ([EMAIL PROTECTED]) wrote:
> I heard that Christoph H. wrote this on 29/10/00:
>
> > You are searching for a string in the name of all files in the
> > current dir and subdirs, but I think you want to search for a string
> > _within_ all files.
> >
Am Montag, 30. Oktober 2000 00:39 schrieb sena:
> I heard that Christoph H. wrote this on 29/10/00:
> > You are searching for a string in the name of all files in the
> > current dir and subdirs, but I think you want to search for a string
> > _within_ all files.
> >
> > Therefore you have to do so
Krzys writes:
>and "mogrep" (below) knows
>what to do with binary and compressed files. -chris
Unfortunately mogrep as implemented relies on the file
names to determine the file type. A neater way might
be to use the 'file' command to determine the file
type
eg:
[EMAIL PROTECTED]:~$ file *
d
I heard that Christoph H. wrote this on 29/10/00:
> You are searching for a string in the name of all files in the
> current dir and subdirs, but I think you want to search for a string
> _within_ all files.
>
> Therefore you have to do something like that:
> find . -exec grep -H char_string {}
Erik Steffl <[EMAIL PROTECTED]> writes:
> find . -type f |xargs grep char_string /dev/null
I use
find . -type f | xargs mogrep $1
where $1 is the expression to search for, and "mogrep" (below) knows
what to do with binary and compressed files. -chris
#!/bin/sh
REGEXP=$1
PRGNAME=`basenam
"Christoph H." wrote:
>
> > I would like to search all files in the current und subdirs for a
> > char_string.
> > Why does this commandstring not work?:
> >
> > ls -R | grep char_string
> >
> > No error , no nothing - although this certain c
> I would like to search all files in the current und subdirs for a
> char_string.
> Why does this commandstring not work?:
>
> ls -R | grep char_string
>
> No error , no nothing - although this certain char_string is in a
> simple ASCII text file!
You are searching for
I would like to search all files in the current und subdirs for a
char_string.
Why does this commandstring not work?:
ls -R | grep char_string
No error , no nothing - although this certain char_string is in a
simple ASCII text file!
Robert
10 matches
Mail list logo