linux下在多个文件夹中查找指定字符串的命令

例如,想要在当前文件夹下的多个.c或者.txt文件中查找“shutdown”字符串,

可以使用“grep shutdown ./*.c”或“grep shutdown ./*.txt”即可

使用find命令如下:find /test -type f -name "*.txt" -exec grep -l "shutdown" {} \;

posted @ 2014-02-21 13:52  依凡兄  阅读(1373)  评论(0编辑  收藏  举报