Skip to main content

How to search for text inside files in Linux

To search for a text pattern in files in linux, do the following:

find / -type f -print0 | xargs -0 grep -i 'your pattern'

Comments

grep -ir 'your pattern'

grep -ir 'your pattern' *

or

find / -type f -exec grep -il 'your pattern' {} \;

Post new comment

The content of this field is kept private and will not be shown publicly.