Disk usage analyzers become important when you want to find out which directory or file in your system is eating up all the space. Baobab is an excellent GUI based choice on Linux. But how about a faster way of finding out disk usage from the console which can also work on a remote system connected over SSH?
ncdu is an ncurses based utility which can show you disk usage in a clean and easily navigable interface. I often use the following command to find out disk usage in a sorted order:
$ du -s *|sort -nr
The advantage of ncdu is it can show hidden files by default. The default list is sorted by size.
ncdu provides a number of useful shortcuts:
up, k Move cursor up down, j Move cursor down right/enter Open selected directory left, <, h Open parent directory n Sort by name (ascending/descending) s Sort by size (ascending/descending) C Sort by items (ascending/descending) d Delete selected file or directory t Toggle dirs before files when sorting g Show percentage and/or graph a Toggle between apparent size and disk usage c Toggle display of child item counts e Show/hide hidden or excluded files i Show information about selected item r Recalculate the current directory q Quit ncdu ? help
To install on Ubuntu:
$ sudo apt-get install ncdu