linux下在多个文件夹中查找指定字符串的命令
例如,想要在当前文件夹下的多个.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" {} \;