[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

How to FIND eller GREP



Hej

Det er muligvis ikke Linux-nørdet nok at sige "føj, hvor kan man dog bruge lang tid på (måske) at kunne finde ud af hvordan FIND kan gøre tilværelsen lettere ved at rtfm", men trods ihærdige forsøg på at fatte FIND-manualen (og GREP) er det endnu ikke lykkedes mig at søge rekursivt efter en fil med en given tekststreng.

Mit ønske: Lav en liste over de filer (inkl. placering) af typen php, som indeholder teksten 'abc'. Medtag alle underkataloger.

1) find . -name "*.php" -exec fgrep -iH puts {} \;
Resultat: Intet fornuftigt; Jeg har fundet denne stump, som jeg har prøvet at bygge videre på, men fatter ikke hvad der sker i den sidste del (puts {} \;)


2) grep -iHr "abc" *.php
Resultat: En liste :-), MEN med unødvendig visning af linien, hvor resultatet fandtes OG UDEN underkataloger. (-r burde lave det rekursivt ifølge manualen)


Det er et fedt om jeg skal bruge kun FIND eller GREP eller om de skal kombineres, sålænge jeg kan finde en måde at finde de filer der har det ønskede indhold :-)

Er der nogen, der kan hjælpe med dette?

Venligst
Michel




 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2006-01-01, 02:03 CET [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *