lululau
V2EX  ›  macOS

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

  •  
  •   lululau · Mar 20, 2013 · 3959 views
    This topic created in 4834 days ago, the information mentioned may be changed or developed.
    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 replies    1970-01-01 08:00:00 +08:00
    tss
        1
    tss  
       Mar 21, 2013
    不错, Moutian lion自带的find不能查隐藏的library,一直拿mdfind当find用。一般都是查出了文件再管道操作,没想到再包装一下
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1096 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 17:57 · PVG 01:57 · LAX 10:57 · JFK 13:57
    ♥ Do have faith in what you're doing.