Download as pdf or txt
Download as pdf or txt
You are on page 1of 20

10/9/21, 5:08 AM How to Check Linux Filesystem Disk Space Utilization


Menu


Menu 

12 Useful “df” Commands to Check Disk Space in Linux

Ravi Saive Last Updated: August 11, 2021 Linux Commands 54 Comments

On the internet, you will find plenty of tools for checking disk space utilization in Linux. However, Linux has
a strong built-in utility called ‘df‘.

The ‘df‘ command stands for “disk filesystem“, it is used to get a full summary of available and used disk
space usage of the file system on the Linux system.

Using ‘ -h ‘ parameter with (df -h) will show the file system disk space statistics in “human-readable”
format, means it gives the details in bytes, megabytes, and gigabyte.

Useful df Command Examples

https://www.tecmint.com/how-to-check-disk-space-in-linux/ 1/20
10/9/21, 5:08 AM How to Check Linux Filesystem Disk Space Utilization

This article explains a way to get the full information of Linux disk space usage with the help of the ‘df‘
command with their practical examples. So, you could better understand the usage of the df command in
Linux.

1. Check File System Disk Space Usage


The “df” command displays the information of device name, total blocks, total disk space, used disk space,
available disk space, and mount points on a file system.

[root@tecmint ~]# df

Filesystem 1K-blocks Used Available Use% Mounted on

/dev/cciss/c0d0p2 78361192 23185840 51130588 32% /

/dev/cciss/c0d0p5 24797380 22273432 1243972 95% /home

/dev/cciss/c0d0p3 29753588 25503792 2713984 91% /data

/dev/cciss/c0d0p1 295561 21531 258770 8% /boot

tmpfs 257476 0 257476 0% /dev/shm

2. Display Information of all File System Disk Space Usage

NoBroker
VISIT SITE
Homes Without Brokerage

The same as above, but it also displays information of dummy file systems along with all the file system
disk usage and their memory utilization.

[root@tecmint ~]# df -a

Filesystem 1K-blocks Used Available Use% Mounted on

/dev/cciss/c0d0p2 78361192 23186116 51130312 32% /

proc 0 0 0 - /proc

sysfs 0 0 0 - /sys

devpts 0 0 0 - /dev/pts

/dev/cciss/c0d0p5 24797380 22273432 1243972 95% /home



/dev/cciss/c0d0p3 29753588 25503792 2713984 91% /data

https://www.tecmint.com/how-to-check-disk-space-in-linux/ 2/20
10/9/21, 5:08 AM How to Check Linux Filesystem Disk Space Utilization

/dev/cciss/c0d0p1 295561 21531 258770 8% /boot

tmpfs 257476 0 257476 0% /dev/shm

none 0 0 0 - /proc/sys/fs/binfmt_misc

sunrpc 0 0 0 - /var/lib/nfs/rpc_pipefs

3. Show Disk Space Usage in Human Readable Format


Have you noticed that the above commands display information in bytes, which is not readable at all
because we are in a habit of reading the sizes in megabytes, gigabytes, etc. as it makes it very easy to
understand and remember.

The df command provides an option to display sizes in Human Readable formats by using '-h' (prints
the results in human-readable format (e.g., 1K 2M 3G)).

[root@tecmint ~]# df -h

Filesystem Size Used Avail Use% Mounted on

/dev/cciss/c0d0p2 75G 23G 49G 32% /

/dev/cciss/c0d0p5 24G 22G 1.2G 95% /home

/dev/cciss/c0d0p3 29G 25G 2.6G 91% /data

/dev/cciss/c0d0p1 289M 22M 253M 8% /boot

tmpfs 252M 0 252M 0% /dev/shm

4. Display Information of /home File System


To see the information of only device /home file systems in human-readable format use the following
command.

[root@tecmint ~]# df -hT /home

Filesystem Type Size Used Avail Use% Mounted on

/dev/cciss/c0d0p5 ext3 24G 22G 1.2G 95% /home

5. Display Information of File System in Bytes


To display all file system information and usage in 1024-byte blocks, use the option ‘ -k ‘ (e.g. --
block-size=1K ) as follows. 

https://www.tecmint.com/how-to-check-disk-space-in-linux/ 3/20
10/9/21, 5:08 AM How to Check Linux Filesystem Disk Space Utilization

[root@tecmint ~]# df -k

Filesystem 1K-blocks Used Available Use% Mounted on

/dev/cciss/c0d0p2 78361192 23187212 51129216 32% /

/dev/cciss/c0d0p5 24797380 22273432 1243972 95% /home

/dev/cciss/c0d0p3 29753588 25503792 2713984 91% /data

/dev/cciss/c0d0p1 295561 21531 258770 8% /boot

tmpfs 257476 0 257476 0% /dev/shm

6. Display Information of File System in MB


To display information of all file system usage in MB (MegaByte) use the option ‘ -m ‘.

[root@tecmint ~]# df -m

Filesystem 1M-blocks Used Available Use% Mounted on

/dev/cciss/c0d0p2 76525 22644 49931 32% /

/dev/cciss/c0d0p5 24217 21752 1215 95% /home

/dev/cciss/c0d0p3 29057 24907 2651 91% /data

/dev/cciss/c0d0p1 289 22 253 8% /boot

tmpfs 252 0 252 0% /dev/shm

7. Display Information of File System in GB


To display information of all file system statistics in GB (Gigabyte) use the option as ‘df -h‘.

[root@tecmint ~]# df -h

Filesystem Size Used Avail Use% Mounted on

/dev/cciss/c0d0p2 75G 23G 49G 32% /

/dev/cciss/c0d0p5 24G 22G 1.2G 95% /home

/dev/cciss/c0d0p3 29G 25G 2.6G 91% /data

/dev/cciss/c0d0p1 289M 22M 253M 8% /boot

tmpfs RedHat RHCSA252M 0 252M


and RHCE Certification 0% /dev/shmGuide -
Preparation Get This Book

8. Display File System Inodes 

https://www.tecmint.com/how-to-check-disk-space-in-linux/ 4/20
10/9/21, 5:08 AM How to Check Linux Filesystem Disk Space Utilization

Using ‘ -i ‘ switch will display the information of a number of used inodes and their percentage for the
file system.

[root@tecmint ~]# df -i

Filesystem Inodes IUsed IFree IUse% Mounted on

/dev/cciss/c0d0p2 20230848 133143 20097705 1% /

/dev/cciss/c0d0p5 6403712 798613 5605099 13% /home

/dev/cciss/c0d0p3 7685440 1388241 6297199 19% /data

/dev/cciss/c0d0p1 76304 40 76264 1% /boot

tmpfs 64369 1 64368 1% /dev/shm

[ You might also like: How to Increase Disk Inode Number in Linux ]

9. Display File System Type


If you notice all the above commands output, you will see there is no Linux file system type mentioned in
the results. To check the file system type of your system use the option ‘ T ‘. It will display file system type
along with other information.

[root@tecmint ~]# df -T

Filesystem Type 1K-blocks Used Available Use% Mounted on

/dev/cciss/c0d0p2 ext3 78361192 23188812 51127616 32% /

/dev/cciss/c0d0p5 ext3 24797380 22273432 1243972 95% /home

/dev/cciss/c0d0p3 ext3 29753588 25503792 2713984 91% /data

/dev/cciss/c0d0p1 ext3 295561 21531 258770 8% /boot

tmpfs tmpfs 257476 0 257476 0% /dev/shm

10. Include Certain File System Type


If you want to display a certain file system type use the ‘ -t ‘ option. For example, the following
command will only display the ext3 file system.

[root@tecmint ~]# df -t ext3

Filesystem 1K-blocks Used Available Use% Mounted on


/dev/cciss/c0d0p2 78361192 23190072 51126356 32% /

https://www.tecmint.com/how-to-check-disk-space-in-linux/ 5/20
10/9/21, 5:08 AM How to Check Linux Filesystem Disk Space Utilization

/dev/cciss/c0d0p5 24797380 22273432 1243972 95% /home

/dev/cciss/c0d0p3 29753588 25503792 2713984 91% /data

/dev/cciss/c0d0p1 295561 21531 258770 8% /boot

11. Exclude Certain File System Type


If you want to display a file system type that doesn’t belongs to the ext3 type use the option ‘ -x ‘. For
example, the following command will only display other file systems types other than ext3.

[root@tecmint ~]# df -x ext3

Filesystem 1K-blocks Used Available Use% Mounted on

tmpfs 257476 0 257476 0% /dev/shm

12. Display Information of df Command.


Using '--help ‘ switch will display a list of available option that is used with df command.

[root@tecmint ~]# df --help

Usage: df [OPTION]... [FILE]...

Show information about the file system on which each FILE resides,

or all file systems by default.

Mandatory arguments to long options are mandatory for short options too.

-a, --all include dummy file systems

-B, --block-size=SIZE use SIZE-byte blocks

-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



-v (ignored)

--help display this help and exit


https://www.tecmint.com/how-to-check-disk-space-in-linux/ 6/20
10/9/21, 5:08 AM How to Check Linux Filesystem Disk Space Utilization
help display this help and exit

--version output version information and exit

SIZE may be (or maybe an integer optionally followed by) one of the following:

kB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.

Report bugs to <bug-coreutils@gnu.org>.

Read Also :

10 fdisk Commands to Manage Linux Disk Partitions


10 Useful “du” Commands to Find Disk Usage of Files and Directories
Ncdu an NCurses Based Disk Usage Analyzer and Tracker
How to Find Out Top Directories and Files (Disk Space) in Linux
9 Tools to Monitor Linux Disk Partitions and Usage in Linux

 Analyzing Linux Disk Usage , Commandline Tools

 18 Tar Command Examples in Linux The Complete Guide to “useradd” Command in


Linux – 15 Practical Examples 

If you liked this article, then do subscribe to email alerts for Linux tutorials. If you have any questions or
doubts? do ask for help in the comments section.

If You Appreciate What We Do Here On TecMint, You Should


Consider:

TecMint is the fastest growing and most trusted community site for any kind of
Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to
search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a
token of appreciation. 

https://www.tecmint.com/how-to-check-disk-space-in-linux/ 7/20
10/9/21, 5:08 AM How to Check Linux Filesystem Disk Space Utilization

We are thankful for your never ending support.

Related Posts

Nethogs – Monitor Linux Network Traffic Usage Per Process

15 Practical Examples of ‘echo’ command in Linux 

https://www.tecmint.com/how-to-check-disk-space-in-linux/ 8/20
10/9/21, 5:08 AM How to Check Linux Filesystem Disk Space Utilization

15 Basic ‘ls’ Command Examples in Linux

https://www.tecmint.com/how-to-check-disk-space-in-linux/ 9/20
10/9/21, 5:08 AM How to Check Linux Filesystem Disk Space Utilization

3 Ways to Find Out Which Process Listening on a Particular Port

16 Top Command Examples in Linux [Monitor Linux Processes]

https://www.tecmint.com/how-to-check-disk-space-in-linux/ 10/20
10/9/21, 5:08 AM How to Check Linux Filesystem Disk Space Utilization

10 Commands to Collect System and Hardware Info in Linux

54 thoughts on “12 Useful “df” Commands to Check Disk


Space in Linux”
← Older Comments

Benjamin
June 2, 2021 at 6:18 am

The ‘df‘ command stands for “disk filesystem”

This is incorrect. ‘df‘ stands for “disk free“.

Reply

Ravi Saive
June 2, 2021 at 12:34 pm

@Benjamin,

The command ‘df’ stands for disk free – see – https://en.wikipedia.org/wiki/Df_(Unix)



Reply

https://www.tecmint.com/how-to-check-disk-space-in-linux/ 11/20
10/9/21, 5:08 AM How to Check Linux Filesystem Disk Space Utilization

euti
October 8, 2020 at 3:01 pm

To display information of all file system statistics in GB (Gigabyte) use the option as ‘df -g‘ ;)

Reply

Akshay K
September 6, 2020 at 9:27 pm

Hello all,

I am a newbie to Linux. I am using CentOS 7 in VMWare.

I tried df -th xfs and got an error as

" df: 'xfs' : No such file or directory. "

But when i reversed the flags and did ‘df -ht xfs‘, I got the proper output.

So my question is that do we have an overriding concept when it comes to flags as I was


confused that why in it showed no such file error with -th? option?

Reply

Emily.Fannie
April 1, 2020 at 2:04 pm

A person’s success does not depend on his wisdom, but perseverance.



Reply
https://www.tecmint.com/how-to-check-disk-space-in-linux/ 12/20
10/9/21, 5:08 AM How to Check Linux Filesystem Disk Space Utilization

Paolo
May 25, 2019 at 1:49 pm

I still don’t know how much disk space i have left.

Reply

Ravi Saive
May 27, 2019 at 12:32 pm

@Paolo,

The df -hT will display the size of all partitions table, there you can easily trace how much space
utilized and left on each partition.

Reply

tradevizer
July 8, 2020 at 8:40 pm

use du not df or better ncdu.

Reply

xing
May 8, 2019 at 8:58 am

df actually stands for: Disk free 

https://www.tecmint.com/how-to-check-disk-space-in-linux/ 13/20
10/9/21, 5:08 AM How to Check Linux Filesystem Disk Space Utilization

from wikipedia: https://en.wikipedia.org/wiki/Df_(Unix)

Reply

James Marsh
November 29, 2018 at 5:09 am

Achtually, if you want to be super correct df -h shows usage in Gibibytes, df -H shows Gigabytes.
The difference gets noticeable at high amounts and people are more used to thinking in Giga
rather than Gibi no matter how much computer techs would prefer it to be the other way around.

Reply

Kiran
June 26, 2019 at 12:27 am

You have put the details other way around -h uses 1024 where as -H uses powers of 1000. -H
numbers would be significantly higher than -h.

Reply

James Marsh
September 16, 2019 at 8:34 pm

I don’t see I left any details on which one is bigger in my original comment. People do get
confused when you tell them they have fewer GiB (1024) than they expected since they are
used to the smaller GB (1000).

Reply

Fred
December 22, 2020 at 12:40 pm 

https://www.tecmint.com/how-to-check-disk-space-in-linux/ 14/20
10/9/21, 5:08 AM How to Check Linux Filesystem Disk Space Utilization

And here in lies the problem with this nonsense called gibibytes etc.
I am a computer tech and no other computer techs I know (under the age of 30), give this
ridiculous notion of a megabyte being 1000×1000 any time of day.
Sorry but a megabyte WILL ALWAYS be 1024 kilobytes (1024 bytes) x 1024 kilobytes no
matter how hard the push is to rename computing standards to fall in line with other
standards of measurements i.e kilogram, kilometre etc

It’s a real pity that in Linux you can’t show file sizes in traditional/correct megabytes,
gigabytes etc
I see Gibibyte and I think Gigabyte. THAT and mass confusion is all this nonsense has
achieved.

Reply

Fred
December 22, 2020 at 12:42 pm

I meant to say ‘over the age of 30’ ;)

← Older Comments

Got something to say? Join the discussion.


Have a question or suggestion? Please leave a comment to start the discussion. Please keep in mind that
all comments are moderated and your email address will NOT be published.

Name * 

https://www.tecmint.com/how-to-check-disk-space-in-linux/ 15/20
10/9/21, 5:08 AM How to Check Linux Filesystem Disk Space Utilization

Email *

Website

Save my name, email, and website in this browser for the next time I comment.

Notify me of followup comments via e-mail. You can also subscribe without commenting.

Post Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Over 3,500,000+ Readers

https://www.tecmint.com/how-to-check-disk-space-in-linux/ 16/20
10/9/21, 5:08 AM How to Check Linux Filesystem Disk Space Utilization

Shop Now

A Beginners Guide To Learn Linux for Free [with Examples]

Get Health Insurance

Plans
Ab Health ki suraksha sirf Rs. 257 prati

mahine mein! Kamaal hai, nai? Get Free

Quotes!
InsuranceDekho

Get Quote

Red Hat RHCSA/RHCE 8 Certification Study Guide [eBooks] 

https://www.tecmint.com/how-to-check-disk-space-in-linux/ 17/20
10/9/21, 5:08 AM How to Check Linux Filesystem Disk Space Utilization

Linux Foundation LFCS and LFCE Certification Study Guide [eBooks]

Get Health Insurance Plans

InsuranceDekho Get Quote

Learn Linux Commands and Tools

Find Out All Live Hosts IP Addresses Connected on Network in Linux

How to Reset Forgotten Root Password in RHEL/CentOS and Fedora

whowatch – Monitor Linux Users and Processes in Real Time

15 Tips On How to Use ‘Curl’ Command in Linux

15 Practical Examples of ‘cd’ Command in Linux

Cron Vs Anacron: How to Schedule Jobs Using Anacron on Linux

https://www.tecmint.com/how-to-check-disk-space-in-linux/ 18/20
10/9/21, 5:08 AM How to Check Linux Filesystem Disk Space Utilization

If You Appreciate What We Do Here On TecMint, You Should Consider:

Linux Server Monitoring Tools

Darkstat – A Web Based Linux Network Traffic Analyzer

4 Useful Commandline Tools to Monitor MySQL Performance in Linux

bmon – A Powerful Network Bandwidth Monitoring and Debugging Tool for Linux

Hegemon – A Modular System Monitoring Tool for Linux

How to Add Windows Host to Nagios Monitoring Server

Install OpenNMS Network Monitoring Tool in CentOS/RHEL 7

https://www.tecmint.com/how-to-check-disk-space-in-linux/ 19/20
10/9/21, 5:08 AM How to Check Linux Filesystem Disk Space Utilization

Learn Linux Tricks & Tips

How to Copy File Permissions and Ownership to Another File in Linux

6 Best CLI Tools to Search Plain-Text Data Using Regular Expressions

How to Make File and Directory Undeletable, Even By Root in Linux

How to Encrypt and Decrypt Files and Directories Using Tar and OpenSSL

How to Monitor Progress of (Copy/Backup/Compress) Data using ‘pv’ Command

How to Generate/Encrypt/Decrypt Random Passwords in Linux

Best Linux Tools

11 Best Tools to Access Remote Linux Desktop

23 Best Open Source Text Editors (GUI + CLI) in 2021

8 Best Screen Recorders for Desktop Screen Recording in Linux

4 Best Linux Apps for Downloading Movie Subtitles

30 Best File Managers for Linux Systems

7 Best Calendar Apps for Linux Desktop in 2020

Donate to TecMint
Contact Us
Advertise on TecMint
Linux Services
Copyright Policy
Privacy Policy
Career

Sponsored Post

Tecmint: Linux Howtos, Tutorials & Guides © 2021. All Rights Reserved.
The material in this site cannot be republished either online or offline, without our permission.

Hosting Sponsored by : Linode Cloud Hosting

https://www.tecmint.com/how-to-check-disk-space-in-linux/ 20/20

You might also like