Mac 命令行下 Spotlight 搜索全攻略
1. Spotlight 命令行工具简介
Spotlight 是 Mac 系统中强大的搜索工具,它能搜索到 find
命令无法触及的元数据,且与 Mac OS X 深度集成,搜索速度通常更快。在命令行中使用 Spotlight,主要涉及四个工具:
- mdfind :搜索 Spotlight 索引,查找与查询匹配的文件。苹果官方文档: http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/mdfind.1.html
- mdimport :将文件添加到 Spotlight 索引中。苹果官方文档: http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/mdimport.1.html
-