Home > Environment & Utility > df

Mastering the `df` Command

A guide to the `df` command, which reports disk space usage of file systems in Linux. This tool allows you to easily check the available space, total space, and usage of all mounted file systems.

Key Options

Create a disk space usage report by combining various options of the `df` command.

1. Basic Inquiry

2. Filtering and Output

3. Specifying File Systems

Generated command:

Try combining the commands.

Description:

`df` Executes the command.

Combine the above options to virtually execute commands with AI.

Understanding the Output

The output of the `df` command consists of several columns, each providing important information about the file system's disk usage.

Explanation of `df -h` Output Columns This is the meaning of each column that appears when you run the `df -h` command.
Column Name Description
Filesystem Name of the file system (device or network path)
Size Total size of the file system
Used Currently used space
Avail Available space
Use% Percentage of space used
Mounted on The directory where the file system is mounted

What is an Inode?

An Inode (Index Node) is a data structure in Unix/Linux file systems that stores all information related to a file or directory. File name, owner, permissions, creation/modification time, and the location of data blocks on disk are stored in the Inode. Even if there is remaining disk space, you can no longer create files if all Inodes are exhausted. You can check Inode usage with the `df -i` command.

Usage Examples

Efficiently manage your disk space through practical usage examples of the `df` command.

Check usage of all file systems in a human-readable format

df -h

This is the most commonly used format for quickly grasping the overall disk usage status.

Check usage of a specific mount point

df -h /

Checks the disk space usage of the root file system (`/`).

Check only a specific file system type (e.g., ext4)

df -h -t ext4

Displays the usage of file systems mounted with the ext4 type only.

Check Inode usage

df -i

By checking the usage and availability of inodes instead of disk blocks, you can diagnose inode exhaustion issues caused by too many small files.

View detailed information of all file systems (in block units)

df -a

Shows detailed information for all file systems (including virtual file systems) in basic block units.


Same category commands