The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



Thread: Grep Problem
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-22-2005
avadhani avadhani is offline
Registered User
 

Join Date: Jun 2005
Posts: 15
Grep Problem

Hi,
I want search all files containing some "searchtext" in current dir and sub dir. For this, I used

grep "searchtext" */*

This will search only in sub dir files and does not give results if file containing search text exists in current directory.

and

grep "searchtext" *

This will search only files current directory, not sub directories.

But when I use , following command . I get result.

find . | xargs grep "searchtext"
It searches at both current dir and sub dir .

How to achive this using grep command .

thanks
Reply With Quote
Forum Sponsor