Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How can I get the current disk usage (in %) of my hard drive from the command line?

share|improve this question
    
Now I wonder if there's some commandline equivalent of kdirstat or baobab. –  Ehtesh Choudhury Jun 6 '13 at 23:15
    

2 Answers 2

up vote 35 down vote accepted

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.

share|improve this answer
13  
df -m will show things in megabytes, df -h will show you in the largest possible unit. –  Oli Jan 11 '11 at 15:48
4  
+1 I'm a huge fan of df -h. –  Zoot Jan 11 '11 at 15:56
1  
@Oli: But that won't change the percentage! Kidding, +1. ;) –  htorque Jan 11 '11 at 15:59

ncdu works well from the command line. It's ncurses-based and interactive.

If you want more fine grained disk usage, you should take a look at the answers to http://superuser.com/questions/12611/finding-whats-using-all-the-space-in-nix/604730#604730

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.