grep help

grep help

Post by Rajesh Gupt » Sat, 02 Jun 2001 18:40:05



Hi,

 I have a very deep directory structure and finding it difficult to search a
symbol/text in a file. Is there a tool/script available which will search
all the files in all the directory ? I know one such tool is glimpse but
unfortunately that is not free.

Thanks

Rajesh Gupta

 
 
 

grep help

Post by Yury Petro » Sat, 02 Jun 2001 20:18:10


Try 'find' with '-exec grep <your reg exp> {} \;' as one of find's actions


> Hi,

>  I have a very deep directory structure and finding it difficult to search a
> symbol/text in a file. Is there a tool/script available which will search
> all the files in all the directory ? I know one such tool is glimpse but
> unfortunately that is not free.

> Thanks

> Rajesh Gupta

--
YP

 
 
 

grep help

Post by William Morri » Sat, 02 Jun 2001 20:23:50



>  I have a very deep directory structure and finding it difficult to search a
> symbol/text in a file. Is there a tool/script available which will search
> all the files in all the directory ? I know one such tool is glimpse but
> unfortunately that is not free.

Rajesh

You might use "find", for example:

        find . -name "*.c" | xargs grep text

Regards
--
William Morris

 
 
 

grep help

Post by Nils O. Sel?sda » Sat, 02 Jun 2001 20:30:59



Quote:> Hi,

>  I have a very deep directory structure and finding it difficult to
search a
> symbol/text in a file. Is there a tool/script available which will
search
> all the files in all the directory ? I know one such tool is glimpse
but
> unfortunately that is not free.

grep -r tst * will search for tst in all the files in all the subdirs
of the current directory.
 
 
 

grep help

Post by Josef Moeller » Sun, 03 Jun 2001 00:10:04



> Try 'find' with '-exec grep <your reg exp> {} \;' as one of find's actions

Append "-print" after the \; to get the name of the file which matched.
--
Josef M?llers (Pinguinpfleger bei FSC)
        If failure had no penalty success would not be a prize
                                                -- T.  Pratchett
 
 
 

grep help

Post by Rajesh Gupt » Sun, 03 Jun 2001 13:58:29


Thanks for all the answers. I was not knowing that available tools could be
so powerful. Probably because I am new to unix environment.

In between my grep does not understand -r option :)

regards
Rajesh Gupta




> > Hi,

> >  I have a very deep directory structure and finding it difficult to
> search a
> > symbol/text in a file. Is there a tool/script available which will
> search
> > all the files in all the directory ? I know one such tool is glimpse
> but
> > unfortunately that is not free.
> grep -r tst * will search for tst in all the files in all the subdirs
> of the current directory.

 
 
 

grep help

Post by Nils O. Sel?sda » Wed, 06 Jun 2001 15:49:36



Quote:> Thanks for all the answers. I was not knowing that available tools
could be
> so powerful. Probably because I am new to unix environment.

> In between my grep does not understand -r option :)

Ok, i'm used to the GNU/Linux version of grep ;)
 
 
 

1. grep help needed

in a directory ./Tests are several subdirectories ./Test/test1,
./Test/test2... ./Test/testN

In each subdirectory is a file called stb.log

I try "find ./Test/ -name stb.log | xargs grep blahblah

for blahblah, i am trying to figure out a regexp so that I can get several
lines looking like:

<<<<INCOMING MESSAGE>>>>
Network To STB
    Seq 13, Len 28
    Host iflx-cap-2-2, Drop 1, Set-top 8
    Transmission Time 22:06:02
Close Network Connection Notify
Received at

Of course the Host can change as well as the Trans. Time.

What regexp can I use to suck up all outputs in these logs from the
INCOMING to the Close Network Connection Notify inclusive.

Thanks a zillion times in advance.

Solaris 5.5.1

-benren

2. 100x30 mode problem.

3. grep, help

4. How can Unix can figure out current time accurately??

5. grep help

6. Progress DataBase, iBCS and a Poll error

7. problem with mysqladmin on suse 7.3

8. Grep help!!!!!!! VERY URGENT!!!!!!!

9. need some grep help

10. GREP help please

11. grep help

12. advanced grep help!!