|
|
|
|
||||||
| linux.debian.user debian-user@lists.debian.org. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hey,
I have a directory and several sub-directory and files reside within it. I'm wondering is there any command I can use to search for the certain tring's ocurence? Can any of you me please? Thanks a lot in advance! Rocky -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On 29 Apr 2007 20:04:03 -0700, rocky <rocky2winnie@gmail.com> wrote:
> Hey, > > I have a directory and several sub-directory and files reside within > it. I'm wondering is there any command I can use to search for the > certain tring's ocurence? Can any of you me please? > >From the manpage of grep(1): grep, egrep, fgrep, rgrep - print lines matching a pattern The -r option to grep might fit your need. Also see find(1) if you find yourself needing something more selective. -- Kushal -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Sun, 29 Apr 2007, rocky wrote:
> Hey, > > I have a directory and several sub-directory and files reside within > it. I'm wondering is there any command I can use to search for the > certain tring's ocurence? Can any of you me please? > > Thanks a lot in advance! > Rocky > > find ~/tmp/ -type f -exec grep -l mystring {} \; this will recursivly look for files in ~/tmp/ and print out files that have mystring in them. -+- 8 out of 10 Owners who Expressed a Preference said Their Cats Preferred Techno. -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On Sun, Apr 29, 2007 at 10:54:44PM -0700, Jeff D wrote:
> >I have a directory and several sub-directory and files reside within > >it. I'm wondering is there any command I can use to search for the > >certain tring's ocurence? Can any of you me please? > find ~/tmp/ -type f -exec grep -l mystring {} \; > > this will recursivly look for files in ~/tmp/ and print out files that > have mystring in them. Of course grep has a -R flag for recursive operation ... grep -R "some regexp" . or. rgrep "some string" . Steve -- -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
![]() |
| Outils de la discussion | |
|
|