Monitoring and display disk space usage using df command.

 

Monitoring and display disk space usage using df command.

 

   The df command can be use to display the disk space usage statistic, the df command also display the mounted filesystem and disk space that have been used and free space available on your Linux operating system.. The df command will gather and summarize important statistic about all currently mounted filesystems. The df command is easy to use and usually use to check free space on your hard disk drive, for example;

 

To get a listing of free space on all mounted filesystems execute df command with no arguments.

 

[root@fedoracore ~]# df

Filesystem 1K-blocks Used Available Use% Mounted on

/dev/mapper/VolGroup00-LogVol00 33423168 16560892 15137044 53% /

/dev/sda1 101086 14952 80915 16% /boot

tmpfs 257560 0 257560 0% /dev/shm

[root@fedoracore ~]#

 

Use the df command with -h option to displays the space in human-readable units , the example below show the freespace available in Mb unit:

 

[root@fedoracore ~]# df -h

Filesystem Size Used Avail Use% Mounted on

/dev/mapper/VolGroup00-LogVol00 32G 16G 15G 53% /

/dev/sda1 99M 15M 80M 16% /boot

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

[root@fedoracore ~]#

 

Note: The Use% column shows what percentage of the filesystem that currently in use.

 

To show space on the filesystems those directories are mounted on:

 

[root@fedoracore ~]# df /boot

Filesystem 1K-blocks Used Available Use% Mounted on

/dev/sda1 101086 14952 80915 16% /boot

[root@fedoracore ~]#

 

The df command can be use to get information on inode usage on all mounted filesystem.  To show the inode information execute df command with the ( -i  ) option:

 

[root@fedoracore ~]# df -i

Filesystem Inodes IUsed IFree IUse% Mounted on

/dev/mapper/VolGroup00-LogVol00 8633856 313455 8320401 4% /

/dev/sda1 26104 37 26067 1% /boot

tmpfs 64390 1 64389 1% /dev/shm

[root@fedoracore ~]#

 

The following are some of the flags and arguments that can be used for the df command:

-a, --all include filesystems having 0 blocks

-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 filesystems

--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 filesystems of type TYPE

-T, --print-type print filesystem type

-x, --exclude-type=TYPE limit listing to filesystems not of type TYPE

-v (ignored)

--help display this help and exit

--version output version information and exit

 

NAME:

df - report filesystem disk space usage

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

 

for more information on df command:

# info df

# man df

# df --help

 

Keywords: display file system usage, display file system size, display filesystem type, display inode number, df command, report filesystem usage, filesystem usage, disk space usage, disk space information, disk usage, using df command.