In CentOS and Ubuntu, how do I find out how much free disk space I have left and other disk stats like disk usage?
4 Answers
Type the following command:
df -h
df: disk free-h: makes the output human-readable
- 
        best answer without the need to install additional software!Patoshi パトシ– Patoshi パトシ2019-02-26 19:19:02 +00:00Commented Feb 26, 2019 at 19:19
 - 
        df stands for disk filesystemTypo– Typo2020-01-31 20:42:13 +00:00Commented Jan 31, 2020 at 20:42
 
I covered this pretty extensively in a blog post titled: Command Line Tools for Analyzing Disk Usage on Fedora/CentOS/RHEL.
ncdu
It’s ncurses based, feature rich and has a nice clean interface and it works from within a shell.
        
gt5
- display diskspace used by files & directories within a directory
 - display what’s happened since the last ran (see screenshots below)
 - optionally provides links to the files, so you can also browse them
 - displays entries with their size & the percentage of their parent
 - ommits small files/directories
 - easy browsing using the cursor-keys
 - produces html files for browsing ‘offline’ afterwards
 
          
Disk Usage Analyzer (aka. Baobab)
- Single folder scan
 - Remote scan
 - Monitoring of Home
 - Display Data in Treemaps or as Ringschart
 
      
others...
In particular fsview is a very nice GUI. I like how it organizes the disk usage visually. It’s actually a KDE application (a plugin to Konqueror) but runs just fine under GNOME. It’s typically part of a package called kdeaddons, and shows up in the Applications menu as “File System Viewer” under Accessories.
     
- 
        Thanks, if anyone comes across additional tools please feel free to drop me a note, I'm always interested in finding other tools in this space!2013-04-27 16:44:41 +00:00Commented Apr 27, 2013 at 16:44
 - 
        @slm, may be you can add
cduas well over here. I have mentioned it in the other question's answer. unix.stackexchange.com/a/151684/47538Ramesh– Ramesh2014-08-22 21:34:08 +00:00Commented Aug 22, 2014 at 21:34 - 
        1Thanks, I thought the konqueror plugin is forever dead, but there you found it!dhill– dhill2014-11-27 11:19:07 +00:00Commented Nov 27, 2014 at 11:19
 - 
        @slm blog link is brokenAlexander Malakhov– Alexander Malakhov2016-02-15 07:43:48 +00:00Commented Feb 15, 2016 at 7:43
 - 
        
k4dirstatis my preference, thx on the other options!Aquarius Power– Aquarius Power2017-07-17 21:34:09 +00:00Commented Jul 17, 2017 at 21:34 
There are a few commands you can use like df, du, and a few more. Just man a few commands to find out how to use them. If you still have a problem finding what you need after that just go to any directory and do this:
sudo du --max-depth=1 | sort -nr
You'll get something like:
2318764 ./usr
777036  ./var
328316  ./lib
222620  ./etc
86136   ./boot
    In Ubuntu dfc shows a coloured output of your mounted devices and is available via apt:
sudo apt-get install dfc
output like this:

Unfortunately this is not available for CentOS as an rpm.
- 
        this Q is asking about CentOS options, dfc is not in any RH repos for either CentOS or Fedora. I already checked this earlier today when I saw your Q showing it 8-). If you google for "dfc rpm" you'll see that no hits show up too. It's just not a popular app on either of these distros, hence my extensive list in my A.2014-08-23 00:19:04 +00:00Commented Aug 23, 2014 at 0:19
 - 
        But he asks"in centos and Ubuntu" but thanks for the hint I edited my answerrubo77– rubo772014-08-23 06:02:59 +00:00Commented Aug 23, 2014 at 6:02
 - 
        Sorry, didn't notice the Ubuntu mention in the body, only the title.2014-08-23 06:08:52 +00:00Commented Aug 23, 2014 at 6:08