mac上的find与gnu find

linux上用的find属于gnu find,如果是查找当前路径是可以省略.的,只需要find -name "xxx"
而mac上自带的find是bsd find,.不可以省略,否则会报错/usr/bin/find: illegal option -- n
可以手动安装 https://www.gnu.org/software/findutils

brew install findutils

If you need to use these commands with their normal names, you
can add a "gnubin" directory to your PATH from your bashrc like:
  PATH="/usr/local/opt/findutils/libexec/gnubin:$PATH"

参考log中给出的环境变量配置,添加上即可

posted @ 2023-09-06 21:13  feipeng8848  阅读(54)  评论(0编辑  收藏  举报