文字列 “hoge” が現在のディレクトリ下の各ファイルに何行存在するか検索する。
grep -ci "hoge" *
実行結果
[ec2-user@test pb-dbcustom]$ grep -ci "weekly" */*.php _inc/ajax.php:0 _inc/modal_login.php:0 _inc/top.php:3 activity/activity-loop.php:0 activity/comment.php:0 activity/entry.php:0 activity/index.php:0 activity/post-form.php:0 blogs/blogs-loop.php:0 blogs/create.php:0 blogs/index.php:0 forums/forums-loop.php:0 forums/index.php:0 groups/create.php:0 groups/groups-loop.php:0 groups/index.php:0 members/index.php:0 members/members-loop.php:0 registration/activate.php:0 registration/register.php:0
参考:
http://itpro.nikkeibp.co.jp/article/COLUMN/20060227/230786/?rt=nocnt