PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > linux.debian.user > Search certain string in a directory
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
linux.debian.user debian-user@lists.debian.org.

Search certain string in a directory

Réponse
 
LinkBack Outils de la discussion
Vieux 30/04/2007, 04h30   #1
rocky
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Search certain string in a directory

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
  Réponse avec citation
Vieux 30/04/2007, 05h20   #2
Kushal Kumaran
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Search certain string in a directory

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
  Réponse avec citation
Vieux 30/04/2007, 07h00   #3
Jeff D
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Search certain string in a directory

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
  Réponse avec citation
Vieux 30/04/2007, 07h10   #4
Steve Kemp
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Search certain string in a directory

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
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 04h17.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10898 seconds with 12 queries