df command in linux

Satish Tiwary's picture
DF command in Linux

df(Disk Filesystem) Provides Disk space usage of our File System.

df is a command line utility mostly used for checking disk space utilization in Linux.

 

Now Let us see what happen when we type df on terminal of a linux machine.

 

[root@satish ~]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda3             50300564  19336500  28367564  41% /
tmpfs                   513384         0    513384   0% /dev/shm

so the most important information we got from above command is

(1)The mount points of File Systems

(2)Percentage of Memory Usage

1.How will you display the information of your all file systems.

 

[root@satish ~]# df -a
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda3             50300564  19337300  28366764  41% /
proc                         0         0         0   -  /proc
sysfs                        0         0         0   -  /sys
devpts                       0         0         0   -  /dev/pts
tmpfs                   513384         0    513384   0% /dev/shm
none                         0         0         0   -  /proc/sys/fs/binfmt_misc
sunrpc                       0         0         0   -  /var/lib/nfs/rpc_pipefs

2.Now how will you show all above information in a human readable format.

 

[root@satish ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3              48G   19G   28G  41% /
tmpfs                 502M     0  502M   0% /dev/shm

You can clearly see the detail information of File system /dev/sda3 above in human readable format.

 

3.How to see the information of your /home, /tmp or any file system you want?

[root@satish ~]# df -h /tmp
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3              48G   19G   28G  41% /

or

 

[root@satish ~]# df -hT /tmp
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/sda3     ext3     48G   19G   28G  41% /

4.How to see the information of File System in Bytes?

[root@satish ~]# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda3             50300564  19337344  28366720  41% /
tmpfs                   513384         0    513384   0% /dev/shm

5.How to see the Information of File System in MB?

[root@satish ~]# df -m
Filesystem           1M-blocks      Used Available Use% Mounted on
/dev/sda3                49122     18885     27702  41% /
tmpfs                      502         0       502   0% /dev/shm

6.How to see the information of FileSystem in GB?

[root@satish ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3              48G   19G   28G  41% /
tmpfs                 502M     0  502M   0% /dev/shm

7.How to see the File System Type?

[root@satish ~]# df -T
Filesystem    Type   1K-blocks      Used Available Use% Mounted on
/dev/sda3     ext3    50300564  19337488  28366576  41% /
tmpfs        tmpfs      513384         0    513384   0% /dev/shm

8.How to see the File System Inodes?

[root@satish ~]# df -i
Filesystem            Inodes   IUsed   IFree IUse% Mounted on
/dev/sda3            13008896  248554 12760342    2% /
tmpfs                 128346       1  128345    1% /dev/shm

9.Now how to include only certain file system type?

[root@satish ~]# df -t fuseblk
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda2             52121596  45282364   6839232  87% /win7

10. Now how to exclude some certain file system trype?

[root@satish ~]# df -x fuseblk
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda3             50300564  19337796  28366268  41% /
tmpfs                   513384         0    513384   0% /dev/shm

11.How to change the Block Size?

[root@satish ~]# df --block-size=2048
Filesystem           2K-blocks      Used Available Use% Mounted on
/dev/sda3             25150282   9669332  14182700  41% /
tmpfs                   256692         0    256692   0% /dev/shm
/dev/sda2             26060798  22641182   3419616  87% /win7
Rate this article: 
Average: 3.3 (2786 votes)

Comments

Hi Sir,

Kindly help to share information about Useradd, Usermod, Groupadd, Groupmod,Passwd

Thank you!!

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.