Olivier Lalonde Asked: 2011-01-12 07:19:40 +0800 CST2011-01-12 07:19:40 +0800 CST 2011-01-12 07:19:40 +0800 CST How to get disk usage from command line? 772 How can I get the current disk usage (in %) of my hard drive from the command line? command-line 2 Answers Voted Ehtesh Choudhury 2013-06-07T16:33:13+08:002013-06-07T16:33:13+08:00 ncdu Works well from the command line. It's ncurses-based and interactive. You can install it with sudo apt-get install ncdu. Alternatives Top ten: du -shx * | sort -rh | head -10 If you want more fine grained disk usage, you should take a look at the answers here. Best Answer htorque 2011-01-12T07:22:43+08:002011-01-12T07:22:43+08:00 By using the df command. Here's an example output: $ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 303537496 27537816 260580948 10% / none 950788 252 950536 1% /dev none 959516 232 959284 1% /dev/shm none 959516 388 959128 1% /var/run none 959516 0 959516 0% /var/lock Also take a look at its manpage.
ncdu
Works well from the command line. It's ncurses-based and interactive.
You can install it with
sudo apt-get install ncdu
.Alternatives
du -shx * | sort -rh | head -10
By using the
df
command.Here's an example output:
Also take a look at its manpage.