df

Introduction

The df command is used to check the file system space usage.


Syntax

df [OPTION]... [FILE]...


Important Flags

FlagDescription

-a or --all

Includes pseudo, duplicate, and inaccessible file systems in the output.

-B or --block-size=

Scales sizes by SIZE before printing them.

-H or --si

Prints sizes in a human-readable format using power of 1000.

-h or --human-readable

Prints sizes in a human-readable format. Print sizes in powers of 1024 (e.g., 1023M)

--help

Display this help and exit.

--inodes

Lists inode information instead of block usage.

-l or --local

Limits listing to local file systems.

--no-sync

Do not invoke sync before getting usage info (default).

--output[=FIELD_LIST]

Use the output format defined by FIELD_LIST, or print all fields if FIELD_LIST is omitted.

-P or --portability

Use the POSIX output format.

-T,--print-type

Prints file system type.

-s, --summarize

Get a summary of the directory's usage in a human-readable format.

--sync

Invoke sync before getting usage info.

--time

Show the time of the last modification to any file in the directory or subdirectory.

-t, --type=TYPE

Limit listing to file systems of type TYPE.

-v

(Ignored).

--version

Output version information and exit.


Examples

CommandDescription
df

Check disk usage on all mounted filesystems.

df .

Display available space on the current file system.

df -h

Check disk usage in a human-readable format.

df -h --total

Show total available disk space.

df -h --total|grep ^total

Show only the total available disk space.

df -h /

Check disk space available on the root mount point.

df -h /boot

Check disk space available on the /boot mount point.

df -h --output=source,avail,pcent,target

Customize the output to show only specific fields.

df -i

Show inode usage on each mounted filesystem.

df -k /test

Display information about /test file system in 1024-byte blocks.

df -m /test

Display information about /test file system in MB blocks.

df -T

Display information about all locally file systems.

Last updated