In the Linux/Unix system to check storage details, we use the df command.
the df command is used to report file system disk space usage using the terminal in the Linux system. It displays total space, used space, and available space.
The general syntax of the df command is as follow:
$ df [OPTION]... [FILE]...
Brief description of options available in the df command.
|Sr.No.||Option & Description|
Include duplicate, pseudo, inaccessible file systems
Scale sizes before printing
Display sizes in powers of 1024
Display sizes in powers of 1000
Limit listing to local file systems
Don’t synchronize before getting usage info
Synchronize before getting usage info
Display file system type
Limit listing to the file systems not of specified type
Displays a help message and then exits.
It gives info about the version and then exits.
To check space usage, we use the df command. By default, it is hard to understand the output of the df command.
The below snapshot is the output screen after the execution of the df command in the Linux system.
We can see that /dev/sda5 (root partition) 9736500 have total size 5813352 have used size and 3408844 have available size but what are these numbers? These numbers don’t have any units so we can’t understand.
Make it human readable there is an option available -h or --human-readable that makes it readable.
To display output in human readable format, we use -h or --human-readable option with the df command as shown in below.
$ df --human-readable
$ df -h
After executing above command, it reports the disk space usage in human readable form then we can easily understand disk space usage.
To display output in powers of 1000, we use -H or --si option with the df command in the Linux system using terminal
$ df --si
$ df -H
After executing above command, it reports the disk space usage in powers of 1000. Now we can easily understand disk space usage because we are more familiar with GB.
For more details about df command and check option description use below command.
$ df --help
And check the version information of df command use below command.
$ df --version