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 derfloh 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
Joined
May 7, 2002
Messages
30
Location
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