MTI TEK
  • Home
  • About
  • LLMs
  • Docker
  • Kubernetes
  • Java
  • All Resources
Linux-Ubuntu | df -- display free disk space
  1. Notes
  2. Examples
  3. Command Help (man df)

  1. Notes
    df [OPTION]... [FILE]...
    
    • For each filesystem specified, the "df" command displays statistics about the amount of free disk space on the specified filesystem.

    • For each file or directory specified, the "df" command displays statistics about the amount of free disk space on the filesystem of which a file or directory is a part.

    • If none is specified, the "df" command displays statistics for all mounted filesystems.

    Disk space values are displayed in 1024-byte blocks by default.
  2. Examples
    • Display statistics for all filesystems in "human-readable" output.
      $ df -h
      Filesystem      Size  Used Avail Use% Mounted on
      /dev/sda1        20G  8.5G   10G  46% /
      /dev/sda2       100G   45G   50G  48% /home
      tmpfs           2.0G     0  2.0G   0% /dev/shm
      /dev/sda3       500M   25M  450M   6% /boot
      
    • Display statistics for filesystems of the specified types only.
      $ df -t ext4
      Filesystem     1K-blocks    Used Available Use% Mounted on
      /dev/sda1       20971520 8912896  10485760  46% /
      /dev/sda2      104857600 47185920  52428800  48% /home
      
    • Display statistics for all filesystems except the specified types.
      $ df -x tmpfs
      Filesystem     1K-blocks    Used Available Use% Mounted on
      /dev/sda1       20971520 8912896  10485760  46% /
      /dev/sda2      104857600 47185920  52428800  48% /home
      /dev/sda3         512000   25600    460800   6% /boot
      
    • Display inodes information along with disk space.
      $ df -i
      Filesystem      Inodes   IUsed   IFree IUse% Mounted on
      /dev/sda1      1310720  145632 1165088   12% /
      /dev/sda2      6553600  98304  6455296    2% /home
      tmpfs           524288       1  524287    1% /dev/shm
      
  3. Command Help (man df)
    The following options can be used:
    -a, --all
    |Include pseudo, duplicate, inaccessible file systems.
    
    -B, --block-size=SIZE
    |Scale sizes by SIZE before printing them.
    |SIZE may be followed by the following multiplicative suffixes: kB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on.
    
    -h, --human-readable
    |Print sizes in human readable format (e.g., 1K 234M 2G).
    
    -H, --si
    |Likewise, but use powers of 1000 not 1024.
    
    -i, --inodes
    |List inode information instead of block usage.
    
    -k
    |Like --block-size=1K.
    
    -l, --local
    |Limit listing to local file systems.
    
    -P, --portability
    |Use the POSIX output format.
    
    -t, --type=TYPE
    |Limit listing to file systems of type TYPE.
    
    -T, --print-type
    |Print file system type.
    
    -x, --exclude-type=TYPE
    |Limit listing to file systems not of type TYPE.
    
    --help
    |Display help message and exit.
    
    --version
    |Output version information and exit.
    
© 2025 mtitek