Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recursive text search

Status
Not open for further replies.

Kenton

Technical User
May 7, 2002
30
AU
This is probably REALLY easy ...

How can I search for a specific string within files in a directory and all its subdirectories?

ie I want to find the string "fred" in all the *.sh files in all subdirectories of /home

Thanks
Kenton
 
find /home -type f -name '*.sh' | xargs grep fred vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top