Exploring df - Linux Commands

What is the df Command in Linux?

The df command in Linux is used to display information about disk space usage on file systems. It shows how much space is used, available, and where it’s mounted. It’s a quick and essential tool for monitoring storage on local drives, external disks, and mounted network volumes.

Key features include:

  • Shows total, used, and available disk space
  • Lists mount points for all file systems
  • Supports human-readable format for easy reading
  • Can filter output by file system type or specific paths

Basic Syntax

Terminal window
df [OPTIONS] [FILESYSTEM or PATH]

Example

Terminal window
df

This will display disk usage for all mounted file systems.

Options

OptionWhat It DoesExample
-hHuman-readable sizes (KB, MB, GB)df -h
-TShow file system typedf -T
-aInclude pseudo and hidden file systemsdf -a
-t TYPEShow only file systems of a certain typedf -t ext4
-x TYPEExclude file systems of a certain typedf -x tmpfs

Common Use Cases

  • View disk usage in human-readable format
Terminal window
df -h
  • Check disk usage of a specific directory
Terminal window
df -h /home
  • Show file system types along with disk usage
Terminal window
df -T
  • Exclude temporary file systems like tmpfs
Terminal window
df -h -x tmpfs
  • Display all file systems including dummy mounts
Terminal window
df -a
  • Filter to only show ext4 file systems
Terminal window
df -t ext4

Additional Help

To see all available options:

Terminal window
df --help
# or
man df

Recap

The df command is a simple yet powerful way to monitor disk space on your Linux system. Whether you’re tracking usage on internal drives or mounted volumes, df gives you the insight you need with just a few keystrokes.

Keep your storage in check! 🗂️💾

Thank you

Big thanks for reading! You’re awesome, and I hope this post helped. Until next time!