高效过滤string

  • Post author:
  • Post category:其他


多文件查找会报错

find . -path ./test -prune -o -type f -name *.cpp -print | xargs grep shard_count

find: paths must precede expression:

多文件查找必须加上单引号

如下查找,排查当前目录下test 目录下的文件

grep -r “xx” –exclude-dir 对于子目录查找不生效,需要和下面的结合再一起使用

find . -path ./test -prune -o -type f -name ‘*.cpp’ -print | xargs grep shard_count



版权声明:本文为kunlunyijian原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。