[Ilugc] recursive search

  • From: goda.abishek@xxxxxxxxx (Abishek Goda)
  • Date: Wed Jan 13 13:54:55 2010


How to find the text from a file(directory & subdirectory). (recursive search)

Ex :
Directories :
/prog
/prog/sub1/
/prog/sub1/dir1/
/prog/sub2/

Each folder contains some text files.

I want to search a "text" from all the files in the directory /prog and 
subdirectories.

I tried
cat * | grep "text" ?But it searches only the current directory also it not 
lists the filename.

How do I do this

man grep. you may want to check -R and -H flags once again.

Abishek

Other related posts: