"df" - Display Free Space of File System

Provides a tutorial example on how to use 'df' command to display free spaces of mounted file systems on Linux systems.

To see free spaces of mounted file systems, you can use the "df" command. Here are some sample outputs of the "df" command on my CentOS 8 computer.

1. Display free spaces of all mounted file systems using "df":

herong$ df

Filesystem          1K-blocks    Used Available Use% Mounted on
devtmpfs              3875992       0   3875992   0% /dev
tmpfs                 3894608       0   3894608   0% /dev/shm
tmpfs                 3894608   18192   3876416   1% /run
tmpfs                 3894608       0   3894608   0% /sys/fs/cgroup
/dev/mapper/cl-root  52403200 6279684  46123516  12% /
/dev/mapper/cl-home  40813088  609176  40203912   2% /home
/dev/sda6              999320  148068    782440  16% /boot
tmpfs                  778920    1168    777752   1% /run/user/42
tmpfs                  778920    6960    771960   1% /run/user/1000

2. Display free spaces in unit of Megabyte of all mounted file systems using "df -m":

herong$ df -m

Filesystem          1M-blocks  Used Available Use% Mounted on
devtmpfs                 3786     0      3786   0% /dev
tmpfs                    3804     0      3804   0% /dev/shm
tmpfs                    3804    18      3786   1% /run
tmpfs                    3804     0      3804   0% /sys/fs/cgroup
/dev/mapper/cl-root     51175  6133     45043  12% /
/dev/mapper/cl-home     39857   595     39262   2% /home
/dev/sda6                 976   145       765  16% /boot
tmpfs                     761     2       760   1% /run/user/42
tmpfs                     761     7       754   1% /run/user/1000

3. Display free spaces in unit of Gigabyte of all mounted file systems using "df --block-size=1G":

herong$ df --block-size=1G

Filesystem          1G-blocks  Used Available Use% Mounted on
devtmpfs                    4     0         4   0% /dev
tmpfs                       4     0         4   0% /dev/shm
tmpfs                       4     1         4   1% /run
tmpfs                       4     0         4   0% /sys/fs/cgroup
/dev/mapper/cl-root        50     6        44  12% /
/dev/mapper/cl-home        39     1        39   2% /home
/dev/sda6                   1     1         1  16% /boot
tmpfs                       1     1         1   1% /run/user/42
tmpfs                       1     1         1   1% /run/user/1000

Table of Contents

 About This Book

 Introduction to Linux Systems

 Cockpit - Web Portal for Administrator

 Process Management

 Files and Directories

 Users and Groups

File Systems

"df" - Display Free Space of File System

 Mount USB Drive as File System

 "dd" - Copy Data from/to Storage Devices

 Use "dd" Command to Test I/O Speed

 "du" - Display Disk Usage of Directories

 Mount Windows NTFS File System

 Access Persmissions on "ntfs-3g" File System

 Mount Windows Shared Folders

 W95 Ext'd (LBA) Partition

 Reformat NTFS Partition into EXT4 Partition

 Unreachable Remote File Systems

 Block Devices and Partitions

 LVM (Logical Volume Manager)

 Installing CentOS

 SELinux - Security-Enhanced Linux

 Network Connection on CentOS

 Software Package Manager on CentOS - DNF and YUM

 Running Apache Web Server (httpd) on Linux Systems

 Running PHP Scripts on Linux Systems

 Running MySQL Database Server on Linux Systems

 Running Python Scripts on Linux Systems

 vsftpd - Very Secure FTP Daemon

 Postfix - Mail Transport Agent (MTA)

 Dovecot - IMAP and POP3 Server

 Email Client Tools - Mail User Agents (MUA)

 LDAP (Lightweight Directory Access Protocol)

 GCC - C/C++ Compiler

 Conda - Environment and Package Manager

 Tools and Utilities

 Administrative Tasks

 References

 Full Version in PDF/EPUB