Find text in files using find

How to list all files having particular text in UNIX, you can do it by using find and grep
For example, if we want to list all files in present working directory containing foo, the following command helps

find . -type f | xargs grep foo

Instead of period you can give the directory location.

find /usr/home/akt -type f | xargs grep -i foo
-i for ignore case


Related Posts


No comments: