V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
pxiphx891
0.01D

[分享] 如何快速搜索电脑上的文件

  •  
  •   pxiphx891 · Apr 27, 2022 · 1702 views
    This topic created in 1461 days ago, the information mentioned may be changed or developed.

    macOS 上的搜索功能不太好用,搜的太慢。

    如果定时每小时把所有文件路径写到一个文件里,就可以搜索的很快了。

    给大家分享我写的 crontab

    0 * * * * find /Users/xxx 
    -path '/Users/xxx/Library/Metadata' -prune -o 
    -path '/Users/xxx/Library/Application Support/Google/Chrome' -prune -o 
    -path '/Users/xxx/Library/Caches' -prune -o 
    -type f -a 
    -print0 | 
    xargs -0 ls -lh | 
    awk '{print $5,"@",substr($0,index($0,$9))}' 
    > /Users/xxx/file_and_size.txt
    

    阅读全文: http://hhwyz.com/2022/04/27/%E5%BF%AB%E9%80%9F%E6%90%9C%E7%B4%A2%E6%96%87%E4%BB%B6.html

    5 replies    2022-04-28 12:18:27 +08:00
    poison123
        1
    poison123  
       Apr 27, 2022 via iPhone
    junas7
        2
    junas7  
       Apr 27, 2022
    下个 everything ?
    junas7
        3
    junas7  
       Apr 27, 2022
    哈哈哈没注意看描述,everything 用不了
    err1y
        4
    err1y  
       Apr 27, 2022 via iPhone   ❤️ 1
    可以用 locate 和 updatedb ,效果是一样的
    定时每小时执行 updatedb
    pansongya
        5
    pansongya  
       Apr 28, 2022
    可以把 node_modules 这类 排除一下吗
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1127 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 23:04 · PVG 07:04 · LAX 16:04 · JFK 19:04
    ♥ Do have faith in what you're doing.