find 排除多个目录正确写法

 find ./public/ -path ./public/images -a -prune -o -path ./public/hyd30_product_common -a -prune  -o -path ./public/files -a -prune -o -print0|xargs -0 grep '惠易定' 这样,上面...

 find ./public/ -path ./public/images -a -prune -o -path ./public/hyd30_product_common -a -prune  -o -path ./public/files -a -prune -o -print0|xargs -0 grep '惠易定'


注意:-path后面目录不能有 / 否则搜索不到东西

这样,上面的语句意思可以看成


find .

if ( -path  ./public/images 为真)

    -prune

else if ( -path  ./public/hyd30_product_common 为真)

    -prune

 else if ( -path  ./public/files 为真)

  -prune

else

     -print0

-o,-or 或者,等同于||


-a,-and 并且,等同于&&


-print 打印


-path 路径


-prune This primary always evaluates to true.可以认为走这个分支的意思


  • 发表于 2020-06-28 19:29
  • 阅读 ( 51 )

你可能感兴趣的文章

相关问题

0 条评论

请先 登录 后评论
shitian
shitian

662 篇文章

作家榜 »

  1. shitian 662 文章
  2. 石天 437 文章
  3. 每天惠23 33 文章
  4. 小A 29 文章