di(1)

di1

Disk information

Usage

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 []]

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

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.

M (backwards compatibility)

Print the name of the mount point.

s

Print the filesystem name (device name).

S (backwards compatibility)

Print the filesystem name.

t

Print the filesystem type.

T (backwards compatibility)

Print the filesystem type.

O

Print the filesystem mount options.

Total Available
b

Print the total space on the filesystem.

B

Print the total space on the filesystem available for use by normal users.

In Use
u

Print the space in use on the filesystem (actual space 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.

Free
f

Print the amount of free (unused) space on the filesystem.

v

Print the space available for use by 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).

1

Print the percentage of space in use (actual space used / total disk space).

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).

Percentage Free
a

Print the percentage of space available for use by normal users (space available for use / total disk space).

3

Print the percentage of space free (actual space free / total disk space).

Inodes
i

Print the total number of file slots (inodes) that can be created on the filesystem.

U

Print the number of file slots in use.

F

Print the number of file slots available.

P

Print the percentage of file slots in use.

The default format string for di is smbuvpT.

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.

Examples

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.

Various df equivalent format strings for System V release 4 are:

/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, try one of the following format strings:

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

Environment

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.

The GNU df POSIXLY_CORRECT, and DF_BLOCK_SIZE and the BSD BLOCKSIZE environment variables are honored when possible.

Releases

11 releases since Debian 3.1 (Sarge); the text changed 8 times.

  1. 3.1
  2. 4.0
  3. 5.0
  4. 6.0
  5. 7
  6. 8–9
  7. 10–11
  8. 12
  9. 13

--help until Debian 12 (Bookworm); --inodes until Debian 12 (Bookworm); --no-sync until Debian 12 (Bookworm); --print-type until Debian 12 (Bookworm); --si until Debian 12 (Bookworm); --sync until Debian 12 (Bookworm); --version until Debian 12 (Bookworm); -A until Debian 12 (Bookworm); -B until Debian 12 (Bookworm); -C until Debian 12 (Bookworm); -H until Debian 12 (Bookworm); -I until Debian 12 (Bookworm); -L until Debian 12 (Bookworm); -P until Debian 12 (Bookworm); -R until Debian 12 (Bookworm); -W until Debian 12 (Bookworm); -X until Debian 12 (Bookworm); -Z until Debian 12 (Bookworm); -a until Debian 12 (Bookworm); -b until Debian 6.0 (Squeeze); -c until Debian 12 (Bookworm); -d until Debian 12 (Bookworm); -f until Debian 12 (Bookworm); -g until Debian 12 (Bookworm); -h until Debian 12 (Bookworm); -i until Debian 3.1 (Sarge); -j until Debian 12 (Bookworm); -k until Debian 12 (Bookworm); -l until Debian 12 (Bookworm); -m until Debian 12 (Bookworm); -n until Debian 12 (Bookworm); -q until Debian 12 (Bookworm); -s until Debian 12 (Bookworm); -t until Debian 12 (Bookworm); -v until Debian 12 (Bookworm); -w until Debian 12 (Bookworm); -x until Debian 12 (Bookworm); -z until Debian 12 (Bookworm).

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

From di 6.0.0-1+b1 in Debian 13 (Trixie). Parsed by carta from the page's man source.