Find files including certain string

I often use this but always forget so write the memo here.
$ find /PATH/TO/DIRECTORY/ -type f -print | xargs grep 'hoge'
Then can search files including 'hoge' string.

If you liked this article

Let's subscribe the updates of Scuti!
Share on Google Plus

About Tomohide Kakeya

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment


  1. -type f is to search with file name
    Or you can use -type d to search with folder name.
    I also tend to forget it so comment here just to memorise :D