• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

df Command in Linux with Examples

{{postValue.id}}

df Command ( Disk Free or Disk File system )

The df command is the static Unix/Linux command to display the summary of available and used disk space usage of file system. The df command first appeared in version 1 AT& T UNIX. The df command has different kinds of options to display the disk usage of the file system.

To display Disk space of file system

df command is used to display the files system path, blocks used spaces and available spaces and it shows mounted point for where the file system is located.

[user1@linuxhelp Desktop]$ df 
Filesystem     1K-blocks      Used           Available       Use%    Mounted on
/dev/sda2      15118728       4580592        9770136         40%     /
tmpfs          506272         288            506044          5%      /dev/shm
/dev/sda1      297485         33573          248552          16%     /boot

To display Disk space of file system in Human Readable format

In previous command, df shows disk space of files system in blocks that cannot easy to remember. Using df &ndash h ‘ -h’ stands for human readable. It will clearly display file size in Kilobyte (KB), Megabyte (MB), Gigabyte (GB), etc. By using this df -h you can easily remember the size of the file system. Here you can also add options -k to display size in KB and -m to display size in MB.

[user1@linuxhelp Desktop]$ df -h
Filesystem      Size     Used    Avail   Use%  Mounted on
/dev/sda2       15G      4.4G    9.4G    32%    /
tmpfs           495M     228K    495M    1%     /dev/shm
/dev/sda1       291M     33M     243M    12%    /boot

To display all used file or dummy file system in Disk

This option displays the information of dummy file systems along with all the file system disk usage and their memory utilization.

[user1@linuxhelp Desktop]$ df -ah 
Filesystem       Size    Used    Avail    Use%    Mounted on
/dev/sda2        15G     4.4G    9.4G     32%     /
 proc            0         0     0        -       /proc
sysfs            0         0     0        -       /sys
devpts           0         0     0        -       /dev/pts
tmpfs            495M    228K    495M     1%      /dev/shm
/dev/sda1        477M    71M     381M     16%     /boot
none             0       0       0        -       /proc/sys/fs /binfmt_misc

To display disk files system in specific Blocks

The -B or --block-size=SIZE option can be used to provide custom format for sizes. SIZE may be one of following: KB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P, E, Z, and Y.

[user1@linuxhelp Desktop]$ df -B 1000 
Filesystem       1kB-blocks     Used          Available     Use%     Mounted on
/dev/sda2        15481578       4690559       10004587      32%      /
tmpfs            518423         234           518190        1%       /dev/shm
/dev/sda1        304625         34379         254518        12%      /boot
[user1@linuxhelp Desktop]$ df -B 1024
Filesystem       1kB-blocks      Used         Available     Use%     Mounted on
/dev/sda2        15118728        4690559      10004587      32%      /
tmpfs            506272          288          506044        1%       /dev/shm
/dev/sda1        304625          34379        248552        12%      /boot

To display grand total of the file system in disk

Option -total displays the grand total of the disk usage

[user1@linuxhelp Desktop]$ df &ndash h --total 
Filesystem      Size     Used     Avail    Use%   Mounted on
/dev/sda2       15G      4.4G     9.4G     32%     /
tmpfs           495M     228K     495M     1%      /dev/shm
/dev/sda1       291M     33M      243M     12%     /boot
total           16G      4.5G     11G      31%

To display only particular file system on disk

The following df command display only particular file system information' s.

[user1@linuxhelp Desktop]$ df  -h /etc 
Filesystem      Size    Used   Avail   Use%   Mounted on
/dev/sda2       15G     4.4G    9.4G   32%    /

To display the inodes status of the all file system in Disk

Using df &ndash i command you can check the inodes values for particular file system for example, df &ndash i /home.

[user1@linuxhelp Desktop]$ df -i 
Filesystem       Inodes       IUsed       IFree       IUse%      Mounted on
/dev/sda2        960992       110042      850950       12%         /
tmpfs            126568       6           126562       1%          /dev/shm
/dev/sda1        76912        38          76874        1%          /boot

To print the file system type for the all mounted file system in Disk

Using df &ndash Th command you can check the file type for particular file system for example, df &ndash i /etc and now it will shows the file system type for /etc.

[user1@linuxhelp Desktop]$ df -Th 
Filesystem       Type      Size     Used     Avail    Use%    Mounted on
/dev/sda2        ext4      15G      4.4G     9.4G     32%     /
tmpfs            tmpfs     465M     215M     495G     6%      /dev/shm
/dev/sda1        ext4      291M     33M      243M     12%     /boot

To include certain file system type in Disk

Using this df command df &ndash t it will display only the particular file system types, above commands display only ext4 file type.

[user1@linuxhelp Desktop]$ df -t ext4 
#df  -Tht ext4
Filesystem       Type        Size         Used        Avail    Use%       Mounted on
/dev/sda2        ext4        15G          4.4G        9.4G     32%         /
/dev/sda1        ext4        290M         33M         243M     12%         /boot

To exclude certain file system type in Disk

Using df command df -x will display all file system type except ext4 in disk.

[user1@linuxhelp Desktop]$ df -Thx ext4 
Filesystem     Type    Size     Used    Avail  Use%     Mounted on
tmpfs          tmpfs   495M     228K    495    1%       /dev/shm

To print certain field in the file system type

If you want display the particular field is disk run following command.

This will be working only in Centos7 / Redhat7

[user1@linuxhelp Desktop]$ df  -h --output=fsystem, size
Type           Size
xfs            15G
devtmpfs       486M
tmpfs          494M
tmpfs          494M


The following df command display the content of file system types and size, if you want to add more field also you can add.

The following valid fields are
source -- file system
fstype -- file system type
itotal -- inode values
iused -- inode used
iavail -- inode available
ipcent -- inode used percentage
size -- space usage file system size
used -- file system usage
avail -- space available
pcent -- disk usage percentage
target -- mount point of the file system

Tags:
sebastian
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

What is different between option of "-h" and "-H" with df command in linux?

A

Both option to be check size of the disk space. But if you use "-h" human readable, It will display the sizes in human readable format. Else you will use the "-H" option with "df" command, it

Q

How to find the file system of any file or directory using the "df" command?

A

You can use the option of "-T" to display the file system of any file or directory using the "df" command. For Ex: "df -T"

Q

How to Display Information of File System in Bytes?

A

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

Q

How can I know the entire options to be available for "df" command?

A

You can use the option of "--help" or man page of "df" command to know the entire information and option to be available for "df" command.

Q

How to List the inode information instead of block usage by using the "df" command?

A

You can use the option of "-i" to List the inode information instead of block usage by using the "df" command. For Ex: "df -i /file/path".

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help David Lopez Guillen ?
Ayuda urgente instale SSL para servidor Opensuse y ahora no funciona tengo servicio web

hola segui este tutorial para tener un certificado ssl y ahora no se ve mi app en la red, espero alguien pueda ayudarme, tengo M9oodle en3.5 en un servidor open suse y ahora no funciona por favor ayuda.

https://www.linuxhelp.com/how-to-create-ssl-certificate-in-opensuse

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.