Unix Technical Forum

Grep multiple Directories??

This is a discussion on Grep multiple Directories?? within the AIX Operating System forums, part of the Unix Operating Systems category; --> I'm trying to find a certain pattern but I'm wanting to search all of the directories and the files ...


Go Back   Unix Technical Forum > Unix Operating Systems > AIX Operating System

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-05-2008, 11:26 AM
Mark McWilliams
 
Posts: n/a
Default Grep multiple Directories??

I'm trying to find a certain pattern but I'm wanting to search all of the
directories and the files within each of the directories. Is their a
command to do this? What I'm wanting to do is search for a tty pattern in
the files, for the profile directories, that are sitting in /home Any help
would be appreciated...

Mark


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-05-2008, 11:26 AM
Wil Cooley
 
Posts: n/a
Default Re: Grep multiple Directories??

On Wed, 13 Sep 2006 17:01:35 -0500, Mark McWilliams wrote:

> I'm trying to find a certain pattern but I'm wanting to search all of the
> directories and the files within each of the directories. Is their a
> command to do this? What I'm wanting to do is search for a tty pattern in
> the files, for the profile directories, that are sitting in /home Any help
> would be appreciated...


1. Install GNU grep
2. Use find and xargs:

$ find <path> -type f | xargs grep foo


Wil
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-05-2008, 11:26 AM
Bela
 
Posts: n/a
Default Re: Grep multiple Directories??

Wil Cooley <wcooley@nakedape.cc> wrote:
WC> On Wed, 13 Sep 2006 17:01:35 -0500, Mark McWilliams wrote:
WC>
>> I'm trying to find a certain pattern but I'm wanting to search all of the
>> directories and the files within each of the directories. Is their a
>> command to do this? What I'm wanting to do is search for a tty pattern in
>> the files, for the profile directories, that are sitting in /home Any help
>> would be appreciated...

WC>
WC> 1. Install GNU grep
WC> 2. Use find and xargs:
WC>
WC> $ find <path> -type f | xargs grep foo

Or, in 5.3, use `grep -r <pattern>' <== symlinks followed
`grep -R <pattern>' <== symlinks not followed

I do not think the stock AIX grep in 5.1 had this option, and I don't know
about 5.2.

--
"... I shook my family tree, and a bunch of NUTS fell out ..."
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-05-2008, 11:26 AM
Mark McWilliams
 
Posts: n/a
Default Re: Grep multiple Directories??


"Wil Cooley" <wcooley@nakedape.cc> wrote in message
newsan.2006.09.13.22.14.12.423333@nakedape.cc...
> On Wed, 13 Sep 2006 17:01:35 -0500, Mark McWilliams wrote:
>
>> I'm trying to find a certain pattern but I'm wanting to search all of the
>> directories and the files within each of the directories. Is their a
>> command to do this? What I'm wanting to do is search for a tty pattern
>> in
>> the files, for the profile directories, that are sitting in /home Any
>> help
>> would be appreciated...

>
> 1. Install GNU grep
> 2. Use find and xargs:
>
> $ find <path> -type f | xargs grep foo
>
>
> Wil


I'm using AIX 4.3.3 Will this not work?


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:11 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com