File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ categories :
3+ - tool
4+ keywords :
5+ - mole
6+ - disk
7+ - space
8+ - clean
9+ comments : true
10+ date : 2025-12-25T08:00:00+08:00
11+ title : " [工具] 分析並清理硬碟空間的指令列工具 Mole"
12+ url : /2025/12/25/mole/
13+ images :
14+ - /images/2025-12-25/mole.png
15+ ---
16+
17+ ## 簡介
18+
19+ Mole 是一個用於清理硬碟空間的指令列工具,可以快速找出並刪除不需要的檔案。
20+
21+ GitHub Repo: [ tw93/Mole] ( https://github.com/tw93/Mole )
22+
23+ ## 安裝
24+
25+ Linux
26+
27+ ``` bash
28+ curl -fsSL https://raw.githubusercontent.com/tw93/mole/main/install.sh | bash
29+ ```
30+
31+ MacOS 可以使用 Homebrew 安裝
32+
33+ ``` bash
34+ brew install tw93/tap/mole
35+ ```
36+
37+ ## 使用方法
38+
39+ Mole 提供了多種功能,以下是幾個我本身常用的指令。
40+
41+ ### 刪除 Mac App 殘留檔案
42+
43+ ``` bash
44+ mo uninstall
45+ ```
46+
47+ 完整刪除 Mac App 與其相關的檔案。一般如我們將 Mac App 拖到垃圾桶刪除,會遺留一些設定檔案在系統中,使用 Mole 可以幫我們找出並清理這些殘留檔案。
48+
49+ {{< figure src="/images/2025-12-25/mole-uninstall.png" alt="mo uninstall" caption="https://github.com/tw93/Mole " >}}
50+
51+ ### 硬碟空間分析
52+
53+ ``` bash
54+ mo analyze
55+ ```
56+
57+ 使用 Mole 來分析硬碟空間使用情況,找出佔用大量空間的檔案和資料夾。
58+
59+ 再依據需求使用** 空白鍵** 選取要刪除的項目,最後按下** 刪除鍵** 來刪除選取的檔案。
60+
61+ {{< figure src="/images/2025-12-25/mole-analyze.png" alt="mo analyze" caption="https://github.com/tw93/Mole " >}}
62+
63+
64+ ### 清理軟體開發套件
65+
66+ ``` bash
67+ mo purge
68+ ```
69+
70+ 這個指令會找出如 node_modules、.venv 等開發環境相關的資料夾,讓我們選擇是否要刪除以釋放空間。
71+
72+ {{< figure src="/images/2025-12-25/mole-purge.png" alt="mo purge" caption="https://github.com/tw93/Mole " >}}
You can’t perform that action at this time.
0 commit comments