bash mac OSX 的“定位”Linux 命令替代方案

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/38373920/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 14:54:19  来源:igfitidea点击:

"locate" Linux command alternative for mac OSX

linuxbashmacoscommand-lineterminal

提问by Abhishek

In Linux, we can use the locatecommand to find the files from the terminal. Is there any command available for Mac OSX which works same as the locatecommand?

在 Linux 中,我们可以使用locate命令从终端中查找文件。是否有任何可用于 Mac OSX 的locate命令与该命令的工作方式相同?

I want to find a file in complete filesystem accessible by User(Me) in mac OSX. Can it be done with some command from the terminal?

我想在 mac OSX 中的 User(Me) 可以访问的完整文件系统中找到一个文件。可以通过终端的一些命令来完成吗?

This command should show me the list of all paths where the file of the same name is available.

此命令应该向我显示同名文件可用的所有路径的列表。

回答by Julian

I guess the mdfindcommand is what your are looking for:

我猜这个mdfind命令就是你要找的:

mdfind -name test.pdf