ターミナル上で動作し、ビジュアルな表示でとても見やすく便利な ncdu コマンドを紹介します。
ターミナル上で du コマンドを利用しても確認できますが…(苦笑)
Ubuntu系、Debian系、Raspberry Pi OS(Raspbian) などれあれば、aptコマンドで簡単にインストールできます。
以下にインストール手順と実行したときのキャプチャなどを紹介します。
以下の手順でインストールします。
sudo apt install ncdu -y
ターミナルから ncdu と入力し Enterキーを押します。
中止するときは q キーを押すと ncdu が終了し、プロンプトが戻ってきます。
ncdu コマンドのヘルプを見てみました。
$ ncdu --help 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 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 -L, --follow-symlinks Follow symbolic links (excluding directories) --exclude-caches Exclude directories containing CACHEDIR.TAG --exclude-kernfs Exclude Linux pseudo filesystems (procfs,sysfs,cgroup,...) --confirm-quit Confirm quitting ncdu --color SCHEME Set color scheme (off/dark)
ncdu ディレクトリ指定で、指定したディレクトリ配下の使用容量の確認ができることがヘルプからわかりますね。
ncdu ディレクト
以上、ターミナルでストレージの使用容量をビジュアルで確認できる ncdu コマンドの紹介でした。