文件内容查找 find+grep

it2022-05-09  18

看到chinaunix上一哥们用于查找文件内容的命令:

-----------------------------------------------------------

#> find . -type f  -exec grep 'mingtian'  -l {} \;grep -l :是显示匹配的内容的文件名字!或者:#> find . -type f -name "*.*" |xargs grep 'xiaoshou' -l(这个方法 不好,挺乱的,还慢,推荐前一个方法!)-----------------------------------------------------------

想到自己常用的方法也不错,特记录下来:

#grep "printf" $(find . -name *.c)

转载于:https://www.cnblogs.com/sdphome/archive/2011/04/22/2024416.html

相关资源:数据结构—成绩单生成器

最新回复(0)