How to get disk usage from command line?












126















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











  • superuser.com/questions/9847/…

    – belacqua
    Aug 8 '14 at 21:41
















126















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











  • superuser.com/questions/9847/…

    – belacqua
    Aug 8 '14 at 21:41














126












126








126


36






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










share|improve this question














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







command-line disk-usage






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 11 '11 at 15:19









Olivier LalondeOlivier Lalonde

21.1k51112140




21.1k51112140













  • Now I wonder if there's some commandline equivalent of kdirstat or baobab.

    – Ehtesh Choudhury
    Jun 6 '13 at 23:15











  • superuser.com/questions/9847/…

    – belacqua
    Aug 8 '14 at 21:41



















  • Now I wonder if there's some commandline equivalent of kdirstat or baobab.

    – Ehtesh Choudhury
    Jun 6 '13 at 23:15











  • superuser.com/questions/9847/…

    – belacqua
    Aug 8 '14 at 21:41

















Now I wonder if there's some commandline equivalent of kdirstat or baobab.

– Ehtesh Choudhury
Jun 6 '13 at 23:15





Now I wonder if there's some commandline equivalent of kdirstat or baobab.

– Ehtesh Choudhury
Jun 6 '13 at 23:15













superuser.com/questions/9847/…

– belacqua
Aug 8 '14 at 21:41





superuser.com/questions/9847/…

– belacqua
Aug 8 '14 at 21:41










2 Answers
2






active

oldest

votes


















133














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





















  • 36





    df -m will show things in megabytes, df -h will show you in the largest possible unit.

    – Oli
    Jan 11 '11 at 15:48



















101














ncdu



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

You can install it with sudo apt-get install ncdu.



enter image description here



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.






share|improve this answer





















  • 3





    Install this via sudo apt install ncdu

    – Pedi T.
    May 17 '17 at 4:43






  • 1





    I liked the alternatives. You have to be in the directory you are looking for the large files. But I found it easy to spot the culprit this way without having to install anything.

    – G Trawo
    Sep 18 '18 at 14:49











  • du -shx * | sort -rh | head -10 is a lifesaver! Especially great if you are on a small test server, you have run out of space, and do not already have a fancy utility installed to fix your problems.

    – Michael Plautz
    Oct 4 '18 at 18:52










protected by N0rbert Jan 28 at 20:56



Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



Would you like to answer one of these unanswered questions instead?














2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









133














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





















  • 36





    df -m will show things in megabytes, df -h will show you in the largest possible unit.

    – Oli
    Jan 11 '11 at 15:48
















133














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





















  • 36





    df -m will show things in megabytes, df -h will show you in the largest possible unit.

    – Oli
    Jan 11 '11 at 15:48














133












133








133







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















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














share|improve this answer



share|improve this answer








edited Jan 11 '11 at 15:28

























answered Jan 11 '11 at 15:22









htorquehtorque

47.6k32175213




47.6k32175213








  • 36





    df -m will show things in megabytes, df -h will show you in the largest possible unit.

    – Oli
    Jan 11 '11 at 15:48














  • 36





    df -m will show things in megabytes, df -h will show you in the largest possible unit.

    – Oli
    Jan 11 '11 at 15:48








36




36





df -m will show things in megabytes, df -h will show you in the largest possible unit.

– Oli
Jan 11 '11 at 15:48





df -m will show things in megabytes, df -h will show you in the largest possible unit.

– Oli
Jan 11 '11 at 15:48













101














ncdu



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

You can install it with sudo apt-get install ncdu.



enter image description here



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.






share|improve this answer





















  • 3





    Install this via sudo apt install ncdu

    – Pedi T.
    May 17 '17 at 4:43






  • 1





    I liked the alternatives. You have to be in the directory you are looking for the large files. But I found it easy to spot the culprit this way without having to install anything.

    – G Trawo
    Sep 18 '18 at 14:49











  • du -shx * | sort -rh | head -10 is a lifesaver! Especially great if you are on a small test server, you have run out of space, and do not already have a fancy utility installed to fix your problems.

    – Michael Plautz
    Oct 4 '18 at 18:52
















101














ncdu



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

You can install it with sudo apt-get install ncdu.



enter image description here



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.






share|improve this answer





















  • 3





    Install this via sudo apt install ncdu

    – Pedi T.
    May 17 '17 at 4:43






  • 1





    I liked the alternatives. You have to be in the directory you are looking for the large files. But I found it easy to spot the culprit this way without having to install anything.

    – G Trawo
    Sep 18 '18 at 14:49











  • du -shx * | sort -rh | head -10 is a lifesaver! Especially great if you are on a small test server, you have run out of space, and do not already have a fancy utility installed to fix your problems.

    – Michael Plautz
    Oct 4 '18 at 18:52














101












101








101







ncdu



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

You can install it with sudo apt-get install ncdu.



enter image description here



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.






share|improve this answer















ncdu



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

You can install it with sudo apt-get install ncdu.



enter image description here



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.







share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 28 at 20:58









N0rbert

24.2k850115




24.2k850115










answered Jun 7 '13 at 0:33









Ehtesh ChoudhuryEhtesh Choudhury

3,00221315




3,00221315








  • 3





    Install this via sudo apt install ncdu

    – Pedi T.
    May 17 '17 at 4:43






  • 1





    I liked the alternatives. You have to be in the directory you are looking for the large files. But I found it easy to spot the culprit this way without having to install anything.

    – G Trawo
    Sep 18 '18 at 14:49











  • du -shx * | sort -rh | head -10 is a lifesaver! Especially great if you are on a small test server, you have run out of space, and do not already have a fancy utility installed to fix your problems.

    – Michael Plautz
    Oct 4 '18 at 18:52














  • 3





    Install this via sudo apt install ncdu

    – Pedi T.
    May 17 '17 at 4:43






  • 1





    I liked the alternatives. You have to be in the directory you are looking for the large files. But I found it easy to spot the culprit this way without having to install anything.

    – G Trawo
    Sep 18 '18 at 14:49











  • du -shx * | sort -rh | head -10 is a lifesaver! Especially great if you are on a small test server, you have run out of space, and do not already have a fancy utility installed to fix your problems.

    – Michael Plautz
    Oct 4 '18 at 18:52








3




3





Install this via sudo apt install ncdu

– Pedi T.
May 17 '17 at 4:43





Install this via sudo apt install ncdu

– Pedi T.
May 17 '17 at 4:43




1




1





I liked the alternatives. You have to be in the directory you are looking for the large files. But I found it easy to spot the culprit this way without having to install anything.

– G Trawo
Sep 18 '18 at 14:49





I liked the alternatives. You have to be in the directory you are looking for the large files. But I found it easy to spot the culprit this way without having to install anything.

– G Trawo
Sep 18 '18 at 14:49













du -shx * | sort -rh | head -10 is a lifesaver! Especially great if you are on a small test server, you have run out of space, and do not already have a fancy utility installed to fix your problems.

– Michael Plautz
Oct 4 '18 at 18:52





du -shx * | sort -rh | head -10 is a lifesaver! Especially great if you are on a small test server, you have run out of space, and do not already have a fancy utility installed to fix your problems.

– Michael Plautz
Oct 4 '18 at 18:52





protected by N0rbert Jan 28 at 20:56



Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



Would you like to answer one of these unanswered questions instead?



Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Can I use Tabulator js library in my java Spring + Thymeleaf project?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents