Skip to main content

Command referencedf

df command (Linux / bash / sh / zsh)

Linuxbashshzshdiskbeginner

What it does

Report free and used space for mounted filesystems. When people search for the df command linux disk space, they usually want df's everyday flags, safe examples, and how it differs from related tools. Below you'll find syntax, options, and copyable examples for Bash/sh/zsh.

Report free and used space for mounted filesystems.

Syntax

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

Common options

Flag / optionMeaning
-hUse human-readable size units.
-TInclude filesystem type.
-iReport inode usage instead of blocks.
--totalAdd a total row.

Practical examples

Check disks

df -h

Shows readable usage for mounted filesystems.

Check a path

df -h /var/lib

Reports the filesystem containing the path.

Check inodes

df -ih

Finds filesystems running low on inodes.

Common mistakes

  • Confusing filesystem free space from df with per-directory use from du.
  • Ignoring inode exhaustion when byte capacity remains.

FAQ

What does df do in Linux?

Report free and used space for mounted filesystems.

How do I use df from the terminal?

Start with `df [OPTION]... [FILE]...`, then choose only the options needed for the task.

What is a practical df example?

Try `df -h` — Shows readable usage for mounted filesystems.

Can I use df in a shell script?

Yes. df works in Bash, sh, and Zsh, but scripts should handle quoting, errors, and command output explicitly.

Browse the full Linux and Windows command reference to search more bash, CMD, PowerShell, Conda, and GitHub CLI commands.