官网地址:https://dev.yorhel.nl/ncdu
Ncdu 是一个带有 ncurses 接口的磁盘使用分析器。它旨在在您没有完整图形设置可用的远程服务器上分析磁盘占用情况。
本问以 centos 系统为例
yum install -y ncdu
wget -O ncdu.tar.gz https://dev.yorhel.nl/download/ncdu-1.16.tar.gz
tar -zxvf ncdu.tar.gz
usr/bin
sudo mv ncdu* /usr/bin
ncdu <options> <directory>
(默认为当前路径)
配置项:
-h,–help | This help message |
-q | Quiet mode, refresh interval 2 seconds |
-v,-V,–version | Print version |
-x | Same filesystem |
-e | Enable extended information |
-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 |
–si | Use base 10 (SI) prefixes instead of |
–exclude PATTERN | Exclude files that match PATTERN |
-X, --exclude-from FILE | Exclude files that match any pattern |
-L, --follow-symlinks | Follow symbolic links (excluding |
–exclude-caches | Exclude directories containing |
–exclude-kernfs | Exclude Linux pseudo filesystems |
–confirm-quit | Confirm quitting ncdu |
–color SCHEME | Set color scheme (off/dark) |
执行后回出现一个扫描的界面,这个过程长短和传入的
directory
大小有关,扫描完就可以使用快捷键进行相关操作