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

  1. Notes
    df [filesystem | file | directory ...]

    • 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 512-byte per block counts.
  2. Examples
    • Display statistics for all filesystems in "human-readable" output.
      $ df -H
      Filesystem      Size   Used  Avail  Capacity  iused     ifree     %iused  Mounted on
      /dev/disk1      1000G  500G  500G   50%       -         -         50%     /disk1
      devfs           500k   500k  0B     100%      -         0         100%    /dev1
      foofs           0B     0B    0B     100%      0         0         100%    /foo1
      barfs           0B     0B    0B     100%      0         0         100%    /bar1

    • Display statistics for filesystems of the specified types only.
      $ df -HT devfs,hfs
      Filesystem      Size   Used  Avail  Capacity  iused     ifree     %iused  Mounted on
      /dev/disk1      1000G  500G  500G   50%       -         -         50%     /disk1
      devfs           500k   500k  0B     100%      -         0         100%    /dev1

    • Display statistics for all filesystems except the specified types.
      $ df -HT nodevfs,hfs
      foofs           0B     0B    0B     100%      0         0         100%    /foo1
      barfs           0B     0B    0B     100%      0         0         100%    /bar1

    • (OS X) Display filesystems available on the system.
      $ lsvfs
      Filesystem
      ----------
      nfs
      hfs
      devfs
      CoreStorage
      autofs

  3. Command Help (man df)
    The following options can be used:
    -a
    |Show all mounted filesystems.
    
    -l
    |Only display information about locally-mounted filesystems.
    
    -i
    |Include statistics on the number of free inodes.
    |This option is now the default to conform to Version 3 of the Single UNIX Specification (``SUSv3'')
    |Use -P to suppress this output.
    
    -T
    |Only display statistics for filesystems of the specified types.
    |More than one type may be specified in a comma separated list.
    |The list of filesystem types can be prefixed with "no" to specify the filesystem types for which action should not be taken.
    |The lsvfs command can be used to display filesystems that are available on the system.
    
    -H
    |"Human-readable" output.
    |Use unit suffixes: Byte (-b), Kilobyte (-k), Megabyte (-m), Gigabyte (-g) in order to reduce the number of digits to three or less using base 10 for sizes.
    
    -h
    |"Human-readable" output.
    |Use unit suffixes: Byte (-b), Kilobyte (-k), Megabyte (-m), Gigabyte (-g) in order to reduce the number of digits to three or less using base 2 for sizes.
    
    -b (the default)
    |Use 512-byte blocks.
    |This is only useful as a way to override the BLOCKSIZE specification from the environment.
    
    -k
    |Use 1024-byte (1-Kbyte) blocks.
    |Note that this overrides the BLOCKSIZE specification from the environment.
    
    -m
    |Use 1048576-byte (1-Mbyte) blocks.
    |Note that this overrides the BLOCKSIZE specification from the environment.
    
    -g
    |Use 1073741824-byte (1-Gbyte) blockst.
    |Note that this overrides the BLOCKSIZE specification from the environment.
© 2025  mtitek