例如,想要在当前文件夹下的多个.c或者.txt文件中查找“shutdown”字符串,
可以使用“grep shutdown ./*.c”或“grep shutdown ./*.txt”即可
使用find命令如下:find /test -type f -name "*.txt" -exec grep -l "shutdown" {} \;
例如,想要在当前文件夹下的多个.c或者.txt文件中查找“shutdown”字符串,
可以使用“grep shutdown ./*.c”或“grep shutdown ./*.txt”即可
使用find命令如下:find /test -type f -name "*.txt" -exec grep -l "shutdown" {} \;
原文:http://www.cnblogs.com/wy2325/p/3559323.html