mac下快速定位某个文件的命令

mac下快速定位某个文件的命令

发现mac下找路径的命令特别好用

mdfind -name xxx 
whereis java
whereis python

which fastlane
which match
which gym

但whereis brew 不行,查出来是空的
====================

which命令只是根据PATH环境变量找
whereis命令只是根据标准可执行文件路径进行查找
如果要找的不是可执行文件,而且想在整个系统上找,怎么办?

find / -name xxx

但这样速度太慢,因为它会遍历整个文件系统上的每个文件进行匹配

mac下,有个locate命令,它自动建立和维护文件的索引,所以找起来非常快

mdfind 命令也很好用
mdfind -name xxx

原文地址:https://www.cnblogs.com/zdz8207/p/mac-mdfind-whereis-which.html