我以 Emacs 组织模式保存我的笔记,文件以 .org 结尾。我使用 mdfind 对这些文件进行全文搜索,命令如下:
mdfind -only <dir> kind:org <search terms>
我昨天更新了 Big Sur 11.3。在没有得到预期的搜索结果后,我注意到组织文件的元数据现在将它们标记为“文档”文件。所以我可以使用 kind:doc 进行搜索,但这也可以捕获所有类型的文本文件,以及 html、pdf 等。
新文件和旧文件的元数据示例:
==> mdls 2020-06-27--14-43-20Z--converting_docs_in_epub_format.org | grep -E 'kMDItemKind|kMDItemContentType'
kMDItemContentType = "dyn.ah62d4rv4ge8086xh"
kMDItemContentTypeTree = (
kMDItemKind = "Document"
==> mdls 2020-12-07--17-14-42Z--technology_linuxdesktop.org | grep -E 'kMDItemKind|kMDItemContentType'
kMDItemContentType = "org.orgmode.org"
kMDItemContentTypeTree = (
kMDItemKind = "Org document"
有没有人有任何技巧可以让 mdfind 开始正确标记这些文件,以便我可以再次使用 kind:org 进行搜索?