df command – Check disk space utilization in Linux

df command – df stands for disk free – when used presents with details of disk space used and available in Linux system. By default, file system shows size in bytes of all partition including ones which are inaccessible. The df command is very flexible, you can customize output of filesystem size, include or exclude specific filesystem type.

Syntax

df [options] [device]

Use of df command in Linux with examples

Check filesystem disk space

The most basic use of df command is to check filesystem disk space. This can be done simply using df command on terminal.

Syntax

df

The output displays details for file system device names, disk blocks, total disk space used, available disk space, percentage of usage and mount points on a file system.

Check filesystem disk usage in more usable format (Human readable)

By default, df shows disk usage size in bytes. 1024 bytes will combine to form 1 Kilobyte, 1024 kilobytes combine to form 1 Megabyte and so on. It becomes difficult to understand sizes when displayed in bytes. Most modern system display disk utilization in Kb’s, Mb’s and Gb’s. When df command is used with switch -h displays size human readable format.

Syntax

df -h

Display disk usage in different size formats

As already mentioned df command is very flexible in terms of usage. df command allows user to display size in bytes, Kilobyte, Megabyte and Gigabyte.