ncdu是磁盤目錄占用空間分析工具,支持了很多系統(tǒng)平臺, 是du
的 curses-based 版本。代理事用 c寫的禁舷。官網(wǎng)地址https://dev.yorhel.nl/ncdu
安裝
OSX用brew安裝
brew install ncdu
brew默認把可執(zhí)行文件放在在/usr/local/bin/目錄旅东,你也可以在這里看到ncdu。
使用
ncdu -h
-h This help message
-q Quiet mode, refresh interval 2 seconds
-v Print version
-x Same filesystem
-r Read only
-o FILE Export scanned directory to FILE
-f FILE Import scanned directory from FILE
-0,-1,-2 UI to use when scanning (0=none,2=full ncurses)
--si Use base 10 (SI) prefixes instead of base 2
--exclude PATTERN Exclude files that match PATTERN
-X, --exclude-from FILE Exclude files that match any pattern in FILE
--exclude-caches Exclude directories containing CACHEDIR.TAG
--confirm-quit Confirm quitting ncdu
1.最簡單使用就是ncdu [文件夾]
ncdu dir
掃描dir文件夾行贪。
2.掃描本機:
ncdu / --exclude /Volumes
如果你掛了移動硬盤或連了網(wǎng)絡(luò)硬盤, 加了個 --exclude
的參數(shù)漾稀,掃描時,他會跳過其他掛載點
掃描結(jié)果出來后建瘫,可以按 ?
出來提示:
使用數(shù)字鍵1崭捍、2、3進行切換啰脚,1為快捷鍵殷蛇,2為顯示格式說明,3為ncdu版權(quán)信息。
常用快捷鍵
n :按文件名進行排序
s :按文件大小進行排序
r :重新統(tǒng)計當前文件夾大小
g :用#或百分比顯示各文件/目錄的大小所占的百分比
i :顯示當前文件/目錄信息
du
linuxdu
命令也查看使用空間粒梦。du -sh *
能看到這一級目錄的結(jié)果.
類似的項目
gt5 - Quite similar to ncdu, but a different approach.
tdu - Another small ncurses-based disk usage visualization utility.
TreeSize - GTK, using a treeview.
Baobab - GTK, using pie-charts, a treeview and a treemap. Comes with GNOME.
GdMap - GTK, with a treemap display.
Filelight - KDE, using pie-charts.
KDirStat - KDE, with a treemap display.
QDiskUsage - Qt, using pie-charts.
xdiskusage - FLTK, with a treemap display.
fsv - 3D visualization.
Philesight - Web-based clone of Filelight.