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
"locate" Linux command alternative for mac OSX
提问by Abhishek
In Linux, we can use the locate
command to find the files from the terminal.
Is there any command available for Mac OSX which works same as the locate
command?
在 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 mdfind
command is what your are looking for:
我猜这个mdfind
命令就是你要找的:
mdfind -name test.pdf