Home How do I find all files containing specific text on Linux?
Reply: 0

How do I find all files containing specific text on Linux?

user639
1#
user639 Published in June 25, 2018, 12:18 am

I'm trying to find a way to scan my entire Linux system for all files containing a specific string of text. Just to clarify, I'm looking for text within the file, not in the file name.

When I was looking up how to do this, I came across this solution twice:

find / -type f -exec grep -H 'text-to-find-here' {} \;

However, it doesn't work. It seems to display every single file in the system.

Is this close to the proper way to do it? If not, how should I? This ability to find text strings in files would be extraordinarily useful for some programming projects I'm doing.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.496335 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO