はじめに
サーバー運用をしていると、ディスク容量を確認するケースは多々あるかと思います。
df コマンドや du コマンドを使うケースが多いと思いますが、 良い感じに表示してくれる
duf コマンドというものがあるようなので、試して記事にしました。
環境構築
mac
普通に Homebrew  で入る。
brew install duf
入らない場合は、下記で formula として追加した後に実行する。
brew tap muesli/tap && brew install duf
Linux(CentOS)
sudo yum install https://github.com/muesli/duf/releases/download/v0.6.2/duf_0.6.2_linux_amd64.rpm
使ってみる
こんな感じで色分けして表示される。
オプション
% duf --help
Usage of duf:
  -all
    	include pseudo, duplicate, inaccessible file systems
  -hide string
    	hide specific devices, separated with commas:
    	local, network, fuse, special, loops, binds
  -hide-fs string
    	hide specific filesystems, separated with commas
  -inodes
    	list inode information instead of block usage
  -json
    	output all devices in JSON format
  -only string
    	show only specific devices, separated with commas:
    	local, network, fuse, special, loops, binds
  -only-fs string
    	only specific filesystems, separated with commas
  -output string
    	output fields: mountpoint, size, used, avail, usage, inodes, inodes_used, inodes_avail, inodes_usage, type, filesystem
  -sort string
    	sort output by: mountpoint, size, used, avail, usage, inodes, inodes_used, inodes_avail, inodes_usage, type, filesystem (default "mountpoint")
  -style string
    	style: unicode, ascii (default "unicode")
  -theme string
    	color themes: dark, light (default "dark")
  -version
    	display version
  -warnings
    	output all warnings to STDERR
  -width uint
    	max output width

