Linux df Commands stand for “disk filesystem“, it is used to get full summary of available and used disk space usage of file system on Linux system.
What is linux df commands
df is a standard Unix command used to display the amount of available disk space for file systems on which the invoking user has appropriate read access.
linux df commands Check File System Disk Space Usage
df command displays device name information , total blocks, total disk space, used disk space, available disk space and mount points on a file system.
df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/xda1 414744552 275094172 118575900 70% /
/dev/xda2 1507332924 52630156 1378111616 4% /Home
tmpfs 257476 0 257476 0% /run/user/0
Display Disk Space Usage as Human Readable Format
df command provides an option to display size information in Human Readable format by passing ‘-h’ parameter (prints the results in human readable format (e.g., 1K 2M 3G 1T)).
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xda1 396G 263G 114G 70% /
/dev/xda2 1.5T 51G 1.3T 4% /Home
tmpfs 3.2G 0 3.2G 0% /run/user/0
Display Information of one device like /home File System
To display the information of one device (e.g. /home) file system in human readable format run the following command.
df -hT /home
Filesystem Type Size Used Avail Use% Mounted on
/dev/xda2 ext4 1.5T 51G 1.3T 4% /home
Display Disk Space Usage Information of File System in Bytes
To display all file system information and usage in 1024-byte blocks, use the df command option ‘-k‘ :
df -k
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/xda1 414744552 275097656 118572416 70% /
/dev/xda2 1507332924 52630360 1378111412 4% /home
tmpfs 3283876 0 3283876 0% /run/user/0
Display Disk Space Usage Information of File System in MB
To display Disk Space information of file system usage in MB (Mega Byte) use the option as ‘-m‘.
df -m
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/xda1 405024 268646 115799 70% /
/dev/xda2 1472005 51401 1345809 4% /home
tmpfs 3207 0 3207 0% /run/user/0
Display Disk Space Usage Information of File System in GB
To display Disk Space information of file system usage in GB (Gigabyte) use the option as ‘-h‘.
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xda1 396G 263G 114G 70% /
/dev/xda2 1.5T 51G 1.3T 4% /home
tmpfs 3.2G 0 3.2G 0% /run/user/0
Display File System Type
To check the file system type of your system use the option ‘T‘. It will display file system type and other information as following:
df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/xda1 ext3 414744552 275092992 118577080 70% /
/dev/xda2 ext4 1507332924 52634268 1378107504 4% /home
tmpfs tmpfs 3283876 0 3283876 0% /run/user/0
Display Help Information of Linux df Commands
‘–-help‘ switch will display a list of available option that are used with df command.
df –help