使用命令:
find / | xargs grep 'findstring' 2>&1 | grep 'matches' > 1.txt
其中, 2>&1表示把错误输出重定向到标准输出,不然会出现一大堆grep: ./reverse: Is a directory
另外,grep 'matches'表示过滤只有matches的匹配项,表示找到相关内容的文件
使用命令:
find / | xargs grep 'findstring' 2>&1 | grep 'matches' > 1.txt
其中, 2>&1表示把错误输出重定向到标准输出,不然会出现一大堆grep: ./reverse: Is a directory
另外,grep 'matches'表示过滤只有matches的匹配项,表示找到相关内容的文件