How to get disk space usage on CentOS and RHEL 6/7 using df command step by step guide


How to get  disk space usage  on CentOS and RHEL 6/7 using df command  step by step guide

In this article we will learn how to get disk space usage that means amount of space available and used by the filesystems. We can get directory size using df command.
How to get  disk space usage  on CentOS and RHEL 6/7 using df command  step by step guide
How to get  disk space usage  on CentOS and RHEL 6/7 using df command  step by step guide

Syntax to get disk space usage on CentOS and RHEL  linux system


To get disk space usage the basic syntax is given below

#df <option> <filesystem>

We need to execute the below command to get the information of the whole file systems of the system.

#df  

[root@localhost project]# df

Filesystem           1K-blocks    Used Available Use% Mounted on

/dev/mapper/VolGroup-lv_root

                       6795192 1814456   4612508  29% /

tmpfs                   249716       0    249716   0% /dev/shm

/dev/sda1               487652   73289    384667  17% /boot

 

How to get disk usage info  in human readable format on linux system

To get disk utilization information  in human readable format we use –h flag like this

#df –h 
[root@localhost ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
                      6.5G  1.8G  4.4G  29% /
tmpfs                 244M     0  244M   0% /dev/shm
/dev/sda1             477M   72M  376M  17% /boot
 

How to get disk usage info  along with inode format on linux system

To get disk utilization along with inode we use –i flag like this

#df -i

[root@localhost ~]# df -i

Filesystem           Inodes IUsed  IFree IUse% Mounted on

/dev/mapper/VolGroup-lv_root

                     440640 63489 377151   15% /

tmpfs                 62429     1  62428    1% /dev/shm

/dev/sda1            128016    44 127972    1% /boot

 

How to get type of the file systemy on linux system

To get type of file system we use –T flag like this.

# df -Th  
[root@localhost ~]# df -Th
Filesystem           Type   Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
                     ext4   6.5G  1.8G  4.4G  29% /
tmpfs                tmpfs  244M     0  244M   0% /dev/shm
/dev/sda1            ext4   477M   72M  376M  17% /boot

 
That’s all. If this article is helpful please share it!!!!




SHARE

Admin

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment