Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tlug: Grep for subdirectories?



On Sun, 4 Oct 1998, Neil Booth wrote:

> How do I get grep to search recursively through subdirectories? I
> haven't been able to find a way of searching anything but the current
> directory.

try:

find . -type f | xargs grep 'substring'

that will recursively find everything starting at '.', the current
directory, and grep it for 'substring'.  the '-type f' means look through
regular files only.  Add '-follow' before '-type f' if you want it to
follow symlinks, too (useful when grepping through header files in
/usr/include).

> 
> Thanks, 
> 
>                             Neil
> 
> -------------------------------------------------------
> Pile up the benefits that accrue from studying by
> the light of fireflies reflected on the snow...
> ---------------------------------------------------------------
> Next Meeting: 10 October, 12:30 Tokyo Station Yaesu central gate
> Featuring the IMASY Eng. Team on "IPv6 - The Next Generation IP"
> Next Nomikai: 20 November, 19:30  Tengu TokyoEkiMae 03-3275-3691
> ---------------------------------------------------------------
> Sponsor: PHT, makers of TurboLinux http://www.pht.co.jp
> 

--------------------------------------------------
Scott M. Stone <sstone@example.com, sstone@example.com>
               <sstone@example.com>
Head of TurboLinux Development/Systems Administrator
Pacific HiTech, Inc (USA) / Pacific HiTech, KK (Japan)
http://www.pht.com		http://armadillo.pht.co.jp
http://www.pht.co.jp	        http://www.turbolinux.com


---------------------------------------------------------------
Next Meeting: 10 October, 12:30 Tokyo Station Yaesu central gate
Featuring the IMASY Eng. Team on "IPv6 - The Next Generation IP"
Next Nomikai: 20 November, 19:30  Tengu TokyoEkiMae 03-3275-3691
---------------------------------------------------------------
Sponsor: PHT, makers of TurboLinux http://www.pht.co.jp


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links