I'm a linux newbie. I need to search for a string "teststring" in all *.java files coming under /home/user1/ (including subfolders). How can I do it in linux via shell command.
Tell me more
×
Super User is a question and answer site for
computer enthusiasts and power users. It's 100% free, no registration required.
|
|
The easiest way is to use GNU grep's features:
If you're ever on another unix variant that doesn't have GNU grep, here's a portable way:
|
|||
|
|
|
using ack you just type: |
|||
|
|
|
For this ack aka ack-grep its the killer app in my mind ;) You can |
|||
|
|
|
Found it. Posting it as it might help someone.
Please correct if there is any better way. |
|||||
|