Linux

Linux “df” Commands to Check Disk Space

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
    
   
XsoftHost Support

Share

Recent Posts

Add Extra IP addresses to server configuration On Ubuntu 17.10 and later

Each failover IP address will need its own line in the configuration file. The configuration…

4 years ago

Create RAID Arrays with mdadm on Ubuntu

What is mdadm? The mdadm utility can be used to create and manage storage arrays…

4 years ago

How to change the maximum upload file size for PHP

There are several scenarios that you might need to increase or decrease your php maximum…

6 years ago

How to install Let’s Encrypt Plugin in WHM/cPanel

What is Let’s Encrypt? Let’s Encrypt is a free certificate authority provided by the Internet…

6 years ago

How to install python in my cPanel and add py extension

Python normally installed on all cPanel hosting server because most of Centos/red hat update system…

6 years ago

How to install and enable GUI GNOME Desktop on centos 7

Usually CentOS 7 comes in a numbers of variants, For most users, there are two…

6 years ago