Check the disk usage statistics of mounted partitions or drives using df command

So, yesterday I told you about finding out the size of files or directories using du. This method could take a huge time when you are dealing with a whole filesytem e.g. a partition, external drive etc. To find out the disk usage stats of a file system, there is a specialized tool - a command line utility called df.

Just like du, using "-h" will yield readable stats. Please note that it only shows the output for mounted disks and partitions, not the whole disk.

[shredder12]$ df -h

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              14G  5.4G  7.8G  41% /
none                  493M  276K  493M   1% /dev
none                  501M  6.1M  495M   2% /dev/shm
none                  501M  256K  500M   1% /var/run
none                  501M     0  501M   0% /var/lock
/dev/sda5              95G   66G   25G  73% /home
/dev/sda4              29G   18G   11G  63% /media/sda4

One can also find about inode utilization stats of a filesystem using df.

[shredder12]$ df -i

/dev/sda2             917504  353597  563907   39% /
none                  212507     833  211674    1% /dev
none                  216609      32  216577    1% /dev/shm
none                  216609      88  216521    1% /var/run
none                  216609       4  216605    1% /var/lock
/dev/sda5            6291456  102799 6188657    2% /home

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <img> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <h1> <h2> <h3> <h4> <h5> <h6> <p> <br>
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Image links with 'rel="lightbox"' in the <a> tag will appear in a Lightbox when clicked on.
  • Search Engines will index and follow ONLY links to allowed domains.

More information about formatting options

Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.