di(1)

πŸ“¦
version 6.2.2.2 Β· 4 versions
, in nixos 26.05, nixpkgs unstable, ubuntu resolute, ubuntu stonking

✨ NAME ✨

di β€” disk information. That's the whole vibe. It's the di(1) manual page, bestie, and we're about to make disk usage make sense. 🫢


✨ SYNOPSIS ✨

di [-AacghHjklLmnPqRtZ] [-B block-size] [-d display-size] [-f format]
       [-I include-fstyp-list] [-s sort-type] [-x exclude-fstyp-list] [-X
       debug-level] [-z zone-name] [file [...]]

If file is specified, the usage information for the partition on which file is located is printed. slay

Unless the -a flag is specified, the following mounted filesystems will not normally be displayed:

  • filesystems with total space <= 0
  • loopback filesystems that are duplicates of other normally mounted filesystems (filesystem type of 'lofs', 'none', or 'nullfs')
  • loopback filesystems that are part of a zone (Solaris)
  • filesystems for which the system's ignore flag is set
  • filesystems that have a device name of 'tmpfs', 'cgroup' or 'swap'
  • filesystems that have a device name starting with '/System/' or 'com.apple.TimeMachine.' (both MacOS)

Filesystems that the user does not have permissions to access will not be displayed at all. no cap

Several options may be specified to control the output of di:

✨ OPTIONS ✨

  • -A β€” Print all fields (used for debugging). all the things, bestie
  • -a (compatibility: --all) β€” Prints all mounted devices (normally, those with a total space of zero are not printed e.g. /dev/proc, /dev/fd). the full guest list
  • -B block-size (compatibility: --block-size, -b) β€” Change the base block size from 1024 (default) to the size specified. block-size may be either: k - 1024 bytes or si - 1000 bytes. Use the -d option to change the display size. block-size may be specified in the same manner as the BLOCK_SIZE environment variable, and will set both the block size and the display size. math but make it fashion
  • -c (alias: --csv-output) β€” Comma separated values are output. The titles are output as the format string specifiers. Totals are turned off. See also the -n flag. spreadsheet core
  • -C (alias: --csv-tabs) β€” Values are output with tab separators. See also the -c option. tabs, literally
  • -d display-size (alias: --display-size) β€” Display the usage in units specified by display-size. The display size is calculated based on the block size (-B). display-size may be one of: k - kilobytes (POSIX), m - megabytes, g - gigabytes, t - terabytes, p - petabytes, e - exabytes, z - zettabytes, y - yottabytes, r - ronnabytes, q - quettabytes, h - human readable, H - human readable alternative. The human readable format scales the sizes displayed and appends a suffix (e.g. 48.0k, 3.4M). Sizes within a line may scale to different units. The human readable alternative scales all the sizes in each individual line to the same unit size (the largest needed). If di is compiled without multi-precision support, the larger units may not work correctly or may be inaccurate. big number energy, be careful
  • -f format β€” Use the specified format string format. See the Format Strings section. choose your own adventure
  • -g (alias for: -dg) β€” Display sizes in gigabytes. gigantic
  • -h (alias for: -dh) β€” Display partition sizes in human readable format. Sizes within a line may scale to different unit sizes. human-friendly, we love
  • --help β€” Display some basic usage information. help a bestie out
  • -H (alias for: -dH; compatibility: --human-readable) β€” Display partition sizes in human readable alternative format. All sizes in each individual line are scaled to the same unit size. consistent queen
  • -I include-fstype-list (compatibility: -F, --type) β€” Include only the filesystem types listed in include-fstyp-list. The list is a comma separated list of filesystem types. Multiple -I options may be specified. If the 'fuse' filesystem type is specified, all fuse* filesystems will be included. e.g. -I nfs,tmpfs or -I nfs -I tmpfs. allowlist vibes
  • --inodes β€” Ignored. Use the -f option. not it, use -f
  • -j (alias: --json-output) β€” The data is output as an array of JSON objects. Totals are turned off. Use of format specifiers that specify the same field will result in duplicated field names. (e.g. p, 1, 2). Possible JSON identifiers are: scaling, blocksize, partitions, filesystem, mount, fstype, options, size, used, free, available, percused, percfree, inodes, inodesused, inodesfree, percinodesused. Example Output:
          {
            "scaling" : "human",
            "blocksize" : "1024",
            "partitions" : [
              {
                "filesystem" : "/dev/nvme0n1p7",
                "mount" : "/",
                "size" : "19.1G",
                "used" : "11.0G",
                "available" : "7.0G",
                "percused" : "63%",
                "fstype" : "ext4"
              }
            ]
          }

JSON baddie

  • -k (alias for: -dk) β€” Display sizes in Kbytes. k is for kilobytes
  • -l (compatibility: --local) β€” Display only local filesystems. local only, no tourists
  • -L β€” Turn off check for duplicate filesystems (loopback (lofs/none) mounts). no duplicate drama
  • -m (alias for: -dm) β€” Display sizes in megabytes. mega
  • -n β€” Do not print a header line above the list of filesystems. Useful when parsing the output of di. parser bestie mode
  • --no-sync β€” Ignored. ghosted
  • -P (compatibility: --portability) β€” Output format is POSIX standard. A 1024 byte block size and a display size of kilobytes (-d k) is the default. POSIX periodt
  • --print-type β€” Ignored. Use the -f option. ignored, use -f
  • -q β€” Disable quota checks. no quota check, okay
  • -R (alias: --dont-resolve-symlinks) β€” Do not resolve symlinks (for mount points that have a trailing UUID). leave those symlinks alone
  • -s sort-type β€” Use sort-type to sort the output. The output of di is normally sorted by mount point. The following sort flags may be used to change the sort order:
    • m - by mount point (default)
    • n - leave unsorted (as it appears in the mount table)
    • s - by filesystem
    • T - by total space
    • f - by free space
    • a - by available space
    • t - by filesystem type
    • r - reverse the sort order; This will apply to all sort flags following this sort flag.

These sort options may be combined in any order. e.g.:

di -stsrm # by type, device name, reversed mount;
di -strsrm # by type, reversed device-name, mount.

sorting is self-care

  • --si β€” An alias for -dh -Bsi. metric system moment
  • --sync β€” Ignored. also ghosted
  • -t (compatibility: --total) β€” Print a totals line below the list of filesystems. Only the main pool of pooled filesystems (zfs, advfs, apfs) are added to the total. Pooled filesystems that do not have pool information available (btrfs) will not total up correctly. totals, but read the fine print

It is up to the user to exclude (using the -x option) read-only filesystems (cdfs, iso9660), swap-based (memfs, mfs, tmpfs) filesystems and user (fuse*) filesystems. Excluding the 'fuse' filesystem will exclude all fuse* filesystems. you have been warned, bestie

  • -v β€” Ignored. v for vanished
  • --version β€” Display the di version. version check, slay
  • -w (backwards compatibility) β€” Ignored. The following argument is ignored. old but ignored
  • -W (backwards compatibility) β€” Ignored. The following argument is ignored. same energy
  • -x exclude-fstype-list (compatibility: --exclude-type) β€” Exclude the filesystem types listed in exclude-fstyp-list. The list is a comma separated list of filesystem types. Multiple -x options may be specified. If the 'fuse' filesystem type is excluded, all fuse* filesystems will be excluded. e.g. -x nfs,tmpfs or -x nfs -x tmpfs. blocklist era
  • -X level β€” Set the program's debugging level to debug-level. debug mode, iykyk
  • -z zone-name β€” Display the filesystems for the specified zone. The zone must be visible to the user. zone check
  • -Z (alias for: -z all) β€” Display the filesystems for all visible zones. all the zones

✨ FORMAT STRINGS ✨

The output of di may be specified via a format string. This string may be given either via the -f command line option or as part of the DI_ARGS environment variable. The format string may specify the following columns:

  • m β€” Print the name of the mount point. mount point moment
  • M (backwards compatibility) β€” Print the name of the mount point. same, but retro
  • s β€” Print the filesystem name (device name). device name, periodt
  • S (backwards compatibility) β€” Print the filesystem name. retro device name
  • t β€” Print the filesystem type. fstype, obviously
  • T (backwards compatibility) β€” Print the filesystem type. retro fstype
  • O β€” Print the filesystem mount options. options, the whole vibe

Total Available

  • b β€” Print the total space on the filesystem. total space
  • B β€” Print the total space on the filesystem available for use by normal users. total space for normal users

In Use

  • u β€” Print the space in use on the filesystem (actual space used = total - free). used = total - free
  • c β€” Print the space not available for use by normal users (total - available). Note that this calculation does not work correctly on the 'apfs' filesystem. apfs? calculation says no

Free

  • f β€” Print the amount of free (unused) space on the filesystem. free space, we love
  • v β€” Print the space available for use by normal users. available for normal users

Percentage Used

  • p β€” Print the percentage of space not available for use by normal users (space not available for use / total disk space). percentage not available
  • 1 β€” Print the percentage of space in use (actual space used / total disk space). percentage in use
  • 2 β€” Print the percentage of space in use, BSD-style. Represents the percentage of user-available space in use. Note that values over 100% are possible (actual space used / disk space available to normal users). over 100% is possible, not a glitch

Percentage Free

  • a β€” Print the percentage of space available for use by normal users (space available for use / total disk space). percentage available
  • 3 β€” Print the percentage of space free (actual space free / total disk space). percentage free

Inodes

  • i β€” Print the total number of file slots (inodes) that can be created on the filesystem. inode total
  • U β€” Print the number of file slots in use. inodes used
  • F β€” Print the number of file slots available. inodes free
  • P β€” Print the percentage of file slots in use. inode percentage

The default format string for di is smbuvpT. default queen

The format string may also contain any other character not listed above. The character will be printed as is. e.g. di -f 'mbuvp|iUFP' will print the character '|' between the disk usage and the file slot usage. The command sequence:

di -f 'mbuvp
miUFP'

will print two lines of data for each filesystem. two lines, one icon

✨ EXAMPLES ✨

Okay so heads up bestie, as of version 5.0.0, di no longer supports 512-byte blocks. There may not be an exact match to 512-byte block output. πŸ’€ Not a vibe, just a fact.

Wanna cosplay df? Here are the various df equivalent format strings for System V release 4:

  • /usr/bin/df -v β€” di -P -f msbuf1
  • /usr/bin/df -k β€” di -d k -f sbcvpm
  • /usr/ucb/df β€” di -d k -f sbuv2m

GNU df:

  • df β€” di -dk -f SbuvpM
  • df -T β€” di -dk -f STbuvpM
  • df -h -T β€” di -dh -f STbuvpM

AIX df:

  • df β€” di -d k -f Sbf1UPM
  • df -I β€” di -d k -f Sbuf1M
  • df -I -M β€” di -d k -f SMbuf1

HP-UX bdf:

  • bdf β€” di -d k -f Sbuv2M
  • bdf -i β€” di -d k -f Sbuv2UFPM

MacOS df:

  • bdf -k β€” di -d k -f Sbuv2UFPM
  • bdf -I -h β€” di -d h -B si -f Sbuv2M
  • bdf -Y -I -h β€” di -d h -B si -f STbuv2M

If you like your numbers to add up/calculate the percentage correctly πŸ‘‘ (yes queen, correct math is the whole point), try one of the following format strings:

di -f SMbuf1T
di -f SMbcvpT
di -f SMBuv2T

🌈 ENVIRONMENT VARIABLES 🌈

The DI_ARGS environment variable may be used to specify command line arguments. e.g. If you always want gigabytes displayed, set DI_ARGS equal to "-dg". Any command line arguments specified will override the DI_ARGS environment variable. (CLI stays winning, fr fr.)

The POSIXLY_CORRECT, BLOCKSIZE, BLOCK_SIZE and DF_BLOCK_SIZE environment variables are honored when possible. ✨

Environment variables are processed in the order: POSIXLY_CORRECT, BLOCKSIZE, BLOCK_SIZE, DF_BLOCK_SIZE, DI_ARGS.

🫢 SEE ALSO 🫢

df(1), libdi(3)

πŸ™ˆ BUGS πŸ™ˆ

Open a ticket at https://sourceforge.net/p/diskinfo-di/tickets/

Send bug reports to: brad.lanam.di @ gmail.com

πŸ‘‘ AUTHOR πŸ‘‘

Copyright 1994-2025 by Brad Lanam Pleasant Hill, CA


and that's a wrap bestie πŸ’… this whole lil manual page is di(1), dated 17 Jan 2013, and the copyright slay belongs to Brad Lanam of Pleasant Hill, CA, spanning 1994-2025. go read your disk usage and thrive, mwah πŸŽ€πŸ’–

πŸ“¦ where this page comes from