V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
lululau
V2EX  ›  macOS

前端时间写了小工具,对 mdfind (Spotlight 的命令行前端) 做了简单封装,使用起来更方便一点,命令行工具控可以看看

  •  
  •   lululau · 2013-03-20 15:58:14 +08:00 · 3088 次点击
    这是一个创建于 4065 天前的主题,其中的信息可能已经有所发展或是发生改变。
    https://gitcafe.com/lululau/mdfind4


    mdfind4 - a better mdfind built upon mdfind3

    Spotlight 是 OS X 上非常好用的一个桌面搜索工具,mdfind 是Spotlight 的 CLI frontend,
    虽然 mdfind 的功能足够强大,但是界面非常不友好,例如,要搜索电脑中2013年的文件大小大于 1MB
    的jpg图像文件,需要一个非常复杂的命令。mdfind4 对mdfind进行封装,提供比较易用的界面

    mdfind3: https://gist.github.com/4086771

    usage: mdfind4 [options]

    通过指定若干选项来搜索文件系统中被 Spotlight 索引的文件,每个选项之间是逻辑与的关系. 默认将
    搜索文件系统中所有的被索引文件,可以通过 "-o" 选项来约束其只在某个目录中进行搜索.

    % mdfind4 --content-type com.omnigroup.omnigraffle.graffle --from 2011/11/1 -t '2013-01-01 14:30:24'
    % mdfind4 --query '关键字' --content-type 'com.adobe.pdf'
    % mdfind4 -e mp3 -b10M
    1 条回复    1970-01-01 08:00:00 +08:00
    tss
        1
    tss  
       2013-03-21 08:56:22 +08:00
    不错, Moutian lion自带的find不能查隐藏的library,一直拿mdfind当find用。一般都是查出了文件再管道操作,没想到再包装一下
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3764 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 04:45 · PVG 12:45 · LAX 21:45 · JFK 00:45
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.