Command: du
1. Native ones
du
– Summarize disk usage of the set of FILEs, recursively for directories.
Most popular commands:du -sh /path
– show total summary for a defined path
du -h -d 1 /path
– show directory sizes with custom depth (-d option)
du -h -d 1 /path | sort -hr
– same as previous, but with sort from largest to lowest
df
– report file system disk space usage
2. Dust – Rust-written du improve.
Show result as a pretty tree with sort (Ascending by default)
Repository: https://github.com/bootandy/dust
Output can be limited by depth and reversed from largest to lowest
dust -r -d 1
Also, it has an interesting feature – showing by file count instead of files size
3. Ncdu – N-curses du version
Site: https://dev.yorhel.nl/ncdu
Install on Ubuntu: apt install ncdu
Install on ArchLinux: sudo pacman -S ncdu
It scans the defined directory, show disk usage, and bring the ability to navigate by child directories
4. Dutree – yet another du alternative, written with rust
Repository: https://github.com/nachoparker/dutree
Installation: cargo install dutree
5. Duf – Go-written better df alternative
Repository: https://github.com/muesli/duf
Install on Ubuntu/Debian: apt install duf
Install on ArchLinux: yay -S duf
It is really fast, has a pretty look, and has a killer feature – the ability to output as JSON, that can be useful for monitoring
Photo by Julian Hochgesang on Unsplash