Skip to content

What is DF? How to check disk space in Linux using DF?

The Linux terminal is crammed with commands that you can use to control and inspect just about any aspect of your machine. Be it checking your network status, user accounts or your disk storage.

In this article, we’re taking a look at the DF command and how you can use it to check disk space in Linux.

Also readHow to shutdown Linux from Command Line?


Using the DF command

The basic syntax for the DF command goes like this.

df [flags] filesystem

If you execute the command without any flags (or options), it’ll just output all mounted file systems with relevant information. The data is printed in the following format.

What is DF? How to check disk space in Linux using DF?
  • Filesystem: The name of the file system. 
  • 1K-blocks: Describes the size of the filesystem in terms of 1K data blocks.
  • Used: This shows how many of those 1K blocks are used.
  • Available: This shows how many of those 1K blocks are available.
  • Use%: This shows the percentage of used space out of total space.
  • Mounted on: This shows the directory on which the filesystem is mounted or accessible. 

If you’re looking for a specific file system, mention the name or the mount point in front of the df command. For example, if you want to see the root directory, this is the command you’ll use. 

df /
What is DF? How to check disk space in Linux using DF?

Also read: Linux Chown command explained


Showing Disk Space in human-readable format

As you can see, the df command’s output isn’t exactly beneficial. The command prints out disk space in terms of 1K memory blocks which is super easy for computers to understand, not so much for humans. 

To display disk space in a human-readable format, use the -h flag with the command.

df -h
What is DF? How to check disk space in Linux using DF?

There are other flags that you can use to further filter information from the command. 

  • -t: Displays the fil;e system types along with the output.
  • -x [file system type]: Allows users to limit the out to file system excluding the mentioned type. 
  • -i: Displays the inode usage of each file system, 

Also read: Linux Sudo command explained

Hello There!

If you like what you read, please support our publication by sharing it with your friends, family and colleagues. If you're running an Adblocker, we humbly request you to whitelist us.

Share on facebook
Share on whatsapp
Share on twitter
Share on reddit
Share on linkedin
Share on pocket
Share on pinterest
Share on telegram
Share on stumbleupon
Share on digg
Share on tumblr
Share on email
Share on skype
Share on xing
Share on vk
Share on odnoklassniki
Share on mix







>