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

各位都是经常 Brew cleanup 的吗?

  •  
  •   ech0x · Aug 30, 2018 · 14862 views
    This topic created in 2803 days ago, the information mentioned may be changed or developed.

    前几天,brew cleanup 了一下,磁盘突然多出了 24 个 G。

    各位都是经常性的 brew cleanup 的吗?

    34 replies    2021-01-19 16:41:19 +08:00
    qihu3721
        1
    qihu3721  
       Aug 30, 2018
    每天运行一次
    #!/bin/bash
    brew update && brew upgrade && brew cleanup
    idlerlestat
        2
    idlerlestat  
       Aug 30, 2018   ❤️ 3
    update() {
    if hash brew 2>/dev/null; then
    echo "Updating Homebrew"
    brew update
    echo "Upgrading Homebrew"
    brew upgrade
    echo "Upgrading Homebrew Casks"
    brew cu -a -y
    echo "Some additional cleaning"
    brew cleanup -s
    find $(brew --cache) -maxdepth 2 -type f -delete
    fi
    }
    agagega
        3
    agagega  
       Aug 30, 2018 via iPhone
    128G,没办法
    wu67
        4
    wu67  
       Aug 30, 2018
    ```bash
    echo "$ brew update..."
    brew update

    echo "$ brew upgrade..."
    brew upgrade

    echo "$ brew cleanup..."
    brew cleanup

    echo "$ npm upgrade -g"
    npm upgrade -g

    caskapp=`brew cask list`

    for app in $caskapp
    do
    echo "$ try upgrae" ${app}
    brew cask upgrade $app
    done
    ```
    自己写的的渣渣脚本
    congeec
        5
    congeec  
       Aug 30, 2018
    brew up --cleanup
    icanfork
        6
    icanfork  
       Aug 30, 2018
    我也基本没有运行过,然后看到这个帖,尝试了下
    ==> This operation has freed approximately 889B of disk space.
    这,剧本不一样啊
    NSAtools
        7
    NSAtools  
       Aug 30, 2018
    This operation has freed approximately 105.0MB of disk space
    SKull4
        8
    SKull4  
       Aug 30, 2018
    ==> This operation has freed approximately 313.6MB of disk space.
    lddsb
        9
    lddsb  
       Aug 30, 2018
    如果你装了 rust 而且经常 brew upgrade 的话,你就会知道 brew cleanup 是多么重要。。
    lucifer9
        10
    lucifer9  
       Aug 30, 2018
    别忘了还有 brew prune
    MagicRabbit0503
        11
    MagicRabbit0503  
       Aug 30, 2018
    This operation has freed approximately 97.3MB of disk space.
    ech0x
        12
    ech0x  
    OP
       Aug 30, 2018
    @belin520 #6 我也不知道为什么我能有这么大
    haha1903
        13
    haha1903  
       Aug 30, 2018
    This operation has freed approximately 3.7GB of disk space.
    ChopinWong
        14
    ChopinWong  
       Aug 30, 2018
    brew update
    brew upgrade
    brew prune
    brew cleanup
    bjfane
        15
    bjfane  
    PRO
       Aug 30, 2018
    This operation has freed approximately 64B of disk space. 没事就会清。 哈哈
    RoshanWu
        16
    RoshanWu  
       Aug 30, 2018
    alias bubo='brew update && brew outdated'
    alias bubc='brew upgrade && brew cleanup'
    alias bubu='bubo && bubc'
    mogita
        17
    mogita  
       Aug 30, 2018
    This operation has freed approximately 541.7MB of disk space.
    Baka9
        18
    Baka9  
       Aug 30, 2018
    This operation has freed approximately 7GB of disk space.

    第一次看到这个命令。。(
    DigDeeply
        19
    DigDeeply  
       Aug 30, 2018
    ==> This operation has freed approximately 8.9MB of disk space.
    czjackjin
        20
    czjackjin  
       Aug 30, 2018
    每天 upgrade,今天第一次看到可以 cleanup,多出来 2 个 g,128g 的 ssd,还是蛮可观的
    tyhunter
        21
    tyhunter  
       Aug 30, 2018
    先 upgrade 后 cleanup,清理出 500m 的空间
    edsion996
        22
    edsion996  
       Aug 30, 2018
    This operation has freed approximately 310MB of disk space.
    yeleiyu
        23
    yeleiyu  
       Aug 30, 2018
    This operation has freed approximately 67.1MB of disk space.


    不常用,所以能释放的空间也很有限啊~~~~
    livc
        24
    livc  
       Aug 30, 2018
    ==> This operation has freed approximately 1GB of disk space.
    vjnjc
        25
    vjnjc  
       Aug 30, 2018 via Android
    原来能这样啊,多谢分享
    1002xin
        26
    1002xin  
       Aug 30, 2018
    想起来 up 一次
    dif
        27
    dif  
       Aug 31, 2018
    256 没办法,更新一次执行一次。
    AnyISalIn
        28
    AnyISalIn  
       Aug 31, 2018
    ==> This operation has freed approximately 270.9MB of disk space.
    ShuangFan
        29
    ShuangFan  
       Aug 31, 2018
    最近刚研究了一下 launchctl 写了一个超简单的定时任务,每天固定时间更新清理一下 brew,顺便提醒我订外卖
    yuanxing008
        30
    yuanxing008  
       Sep 1, 2018
    从未执行过、、、待会试试。。不过我 2T 的盘应该不怎么需要经常执行吧。。
    thiswind
        31
    thiswind  
       Nov 15, 2019
    @lucifer9
    @ChopinWong 现在新版本里面 prune 被 deprecated 了,新的写法要加上一个天数,比如早于 3 天的:brew cleanup --prune 3
    thiswind
        32
    thiswind  
       Nov 15, 2019   ❤️ 1
    @qihu3721

    prune 今年 deprecated 了

    #!/bin/bash
    brew update && brew upgrade && brew cleanup && brew cleanup --prune 3 # 清理早于 3 天的
    madao100
        33
    madao100  
       Dec 7, 2020
    @qihu3721 mark
    evam
        34
    evam  
       Jan 19, 2021
    brew prune
    Error: Unknown command: prune



    brew cleanup --prune 3
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2529 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 113ms · UTC 02:59 · PVG 10:59 · LAX 19:59 · JFK 22:59
    ♥ Do have faith in what you're doing.