ファイル内のテキストを検索し、複数のサブフォルダを検索する方法は?

ファイル内のテキストを検索し、複数のサブフォルダを検索する方法は?

関数名を探していますが、フォルダ構造も深く、見るファイルも多いです。

一般的に私はこのようなものを選択しますが、find * | grep functionnameこれが最善のアプローチですか?

ベストアンサー1

$ find . -type f -print0 | xargs -0 grep foo
$ grep -r foo . # GNU grep only

そしてzshsetopt extendedglob

$ grep foo **/*(.)

おすすめ記事