zdz8207

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

 

分类:

技术点:

相关文章:

  • 2022-02-08
  • 2021-12-21
  • 2022-12-23
  • 2022-01-05
  • 2021-08-31
  • 2021-11-15
  • 2021-10-30
猜你喜欢
  • 2022-12-23
  • 2022-01-08
  • 2021-04-18
  • 2021-04-22
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
相关资源
相似解决方案