Linux: Find Out How Much Disk Space Left On Hard Drive

I am a desktop support professional with experience working in a corporate call center environment. Recently, I started to admin RHEL based IBM Linux server. How do I determine how much disk space left in my Linux server? How do I find out how much disk space I have in Linux for each partition?

You need to use the df command. It shows the amount of disk space available on the currently mounted file system. df is used to show or find out following information:
Tutorial details
Difficulty level Easy
Root privileges Yes
Requirements df
Est. reading time 2 minutes
  1. Used and available space.
  2. File system mount points.
  3. File system capacity.
  4. The number of inodes available.
  5. Find of whether there is sufficient space to upgrade or install new apps.


The basic syntax is as follows:

df /path/to/dev
df [options] df [options] /path/to/dev


Type the following command:
# df
# df -H

Sample outputs:

Fig.01: df command in action

The following example will provide information only for the partition/device that contains the /home directory:
# df /home
# df -h /home

To see inode usage instead of block usage, type:
# df -i
# df -i /
# df -ih /
# df -i /dev/md0

Sample outputs:

Filesystem            Inodes   IUsed   IFree IUse% Mounted on
/dev/md0             7872512   35813 7836699    1% /

Pass the -T to find out file system type:
# df -T -h
Sample outputs:

Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/md0      ext4    119G  1.8G  111G   2% /
tmpfs        tmpfs   1002M     0 1002M   0% /lib/init/rw
udev         tmpfs   1000M  260K 1000M   1% /dev
tmpfs        tmpfs   1002M     0 1002M   0% /dev/shm
/dev/md2      ext4    1.5T  658G  745G  47% /data
              ext3    591G   78G  484G  14% /securebackup

df command options

From the df command man page:

  -a, --all             include dummy file systems
  -B, --block-size=SIZE  use SIZE-byte blocks
      --total           produce a grand total
  -h, --human-readable  print sizes in human readable format (e.g., 1K 234M 2G)
  -H, --si              likewise, but use powers of 1000 not 1024
  -i, --inodes          list inode information instead of block usage
  -k                    like --block-size=1K
  -l, --local           limit listing to local file systems
      --no-sync         do not invoke sync before getting usage info (default)
  -P, --portability     use the POSIX output format
      --sync            invoke sync before getting usage info
  -t, --type=TYPE       limit listing to file systems of type TYPE
  -T, --print-type      print file system type
  -x, --exclude-type=TYPE   limit listing to file systems not of type TYPE

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 11 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
11 comments… add one
  • Mahdi Jun 9, 2013 @ 23:33

    Again, thank you! :D

  • sangnd Jun 10, 2013 @ 1:58

    Great! Thank you.

  • Bob Ross Jun 10, 2013 @ 2:59

    Df is great for finding the space available on a partition, but it doesn’t paint the entire picture of how much space is available on a hard drive. You would need to check the LVM displays as well as fdisk in order to best answer the question laid out in this article’s title.

  • AshnaRoy Jun 10, 2013 @ 9:48

    Thnaks for providing the answer to this question in complete detail….

  • meow Jun 10, 2013 @ 14:53

    you can alse use “findmnt” which might not be provided in ALL UNIX-like variants.

  • Saenthan Jul 5, 2013 @ 6:12

    Findmnt or df command

  • Sleepee Sep 22, 2013 @ 20:17

    I use df to see how much available space there is on a mounted partition, but is there a good way to see how much space is used vs available on a whole disk, including unpartitioned space?
    i suppose i could just look at df output and then compare that to fdisk’s output…
    but i’m lazy and i’d love to find a better way or just a single utility/command that would do that for me.

  • nitiratna Oct 23, 2013 @ 3:26

    use “cfdisk” command

  • Sleepee Oct 24, 2013 @ 5:09

    Thanks for the tip. Cfdisk works pretty good. It makes my life a lot easier when I want to manage partitions from the CLI. Its a lot more visual than fdisk or parted and it’s dead simple. Seems like the next best thing if you don’t have access to gparted.
    But even though cfdisk is great, I still wish there was a command like df that would simply return the available free space on the drive, like df does with partitions.

  • aa Feb 14, 2014 @ 4:40


  • aref ghobadi Aug 16, 2015 @ 10:43

    it is useful

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum