Cheatsheets
HomeWriteupsResourcesCheatsheets
Linux
Linux
  • Know Yourself and Your System
    • id
    • logname
    • uname
    • w
    • who
    • whoami
  • Surfing / Knowing Your File System
    • cd
    • df
    • du
    • ls
    • pwd
    • stat
    • tree
  • Knowing About Files / Commands
    • alias
    • file
    • info
    • whatis
    • apropos
    • man
    • help
    • history
    • script
  • Manipulating Files / Directories
    • touch
    • mkdir
    • rm
    • rmdir
    • cp
    • mv
    • ln
  • Interacting with Files
    • cat
    • head
    • less
    • middle
    • more
    • tail
  • STROPS / Text Manipulation
    • awk
    • cut
    • grep
    • jq
    • join
    • paste
    • sed
    • sort
    • tr
    • uniq
    • xargs
    • xclip
    • wc
    • tee
    • echo
    • comm
    • diff
    • patch
    • aspell
    • Combos
  • Formatting the Output
    • nl
    • fold
    • fmt
    • pr
    • printf
  • Searching / Finding
    • find
    • locate
    • which
    • whereis
    • type
  • Web Interaction
    • curl
    • wget
  • xxd
  • References
Powered by GitBook
On this page
  • Introduction
  • Syntax
  • Important Flags
  • Examples

Was this helpful?

  1. Surfing / Knowing Your File System

df

Introduction

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


Syntax

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


Important Flags

Flag
Description

-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

Command
Description

Check disk usage on all mounted filesystems.

Display available space on the current file system.

Check disk usage in a human-readable format.

Show total available disk space.

Show only the total available disk space.

Check disk space available on the root mount point.

Check disk space available on the /boot mount point.

Customize the output to show only specific fields.

Show inode usage on each mounted filesystem.

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

Display information about /test file system in MB blocks.

Display information about all locally file systems.

PreviouscdNextdu

Last updated 11 months ago

Was this helpful?

df
df .
df -h
df -h --total
df -h --total|grep ^total
df -h /
df -h /boot
df -h --output=source,avail,pcent,target
df -i
df -k /test
df -m /test
df -T