Search all files for text string

Asked by:
HubFans / n/a Points
Time:
2016-05-01 4:03 pm EST
Category:
General Information
Hits:
93
Is there a way to use 'grep', 'find', or some other mechanism to search recursively a directory structure for a text string?

To ask this user for more information, please first login.

To submit an answer, please login.

ANSWERS

0

ScottM
Staff
16,266 Points
2016-05-02 11:59 am EST
Hello,

Thank you for your question on searching files for a string. The command format I use is:

grep -rl 'abc123' .

This searches for the string (in this case abc123) in all files recursively (-r) and lists the results (l) starting at the directory I am located in (.)

Note you do need to be logged in via SSH to use that command.

Hope that helps!

Kindest Regards,
Scott M

To submit a comment on this answer, please first login.

0

ScottM
Staff
16,266 Points
2016-05-02 12:01 pm EST
Hello,

Thank you for your question on searching files for a string. The command format I use is:

grep -rl 'abc123' .

This searches for the string (in this case abc123) in all files recursively (-r) and lists the results (l) starting at the directory I am located in (.)

Hope that helps!

Kindest Regards,
Scott M

To submit a comment on this answer, please first login.

Want to share this Question?

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!
Need More Help?

Help Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 757-416-6627 Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.
}