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 ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 |
| |||
| 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 |
| |||
| 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 ..." |
| ||||
| "Wil Cooley" <wcooley@nakedape.cc> wrote in message news > 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? |