di - Disk Information Utility


Submit bugs to bll6969di_at_gmail.com

Current Version: 4.13

'di' is a disk information utility, displaying everything (and more) that your 'df' command does. It features the ability to display your disk usage in whatever format you desire/prefer/are used to. It is designed to be portable across many platforms.


Download di:

di version 4.13

Ports:

Debian Linux: http://packages.debian.org/unstable/utils/di

FreeBSD: http://www.freebsd.org/cgi/cvsweb.cgi/ports/sysutils/di/

HP-UX Software Depots: http://www.cmve.net/merijn/downloads.html

MacOS X: http://www.hmug.org/pub/MacOS_X/BSD/Administration/System/di/

SuSE Linux: http://linux01.gwdg.de/~pbleser/rpm-navigation.php?cat=/System/di Older versions.

SuSE Linux: http://software.opensuse.org/search?baseproject=ALL&p=2&q=di May have to switch pages to find it.

NetBSD: http://pkgsrc.se/wip/di

OpenPkg: http://www.openpkg.org/product/packages/?package=di


I can always use access to older / less common operating systems to test on. If you can supply secure-shell access to a standard shell account for occasional access, let me know (bll6969di_at_gmail.com).

di 4.13 has been tested on the following platforms:

FreeBSD 6.1, 7.0
HP-UX B.11.11, B.11.23
CentOS Linux 2.4.21
Debian Linux 2.4.27, 2.6.8
Mandriva Linux 2.6.12
Red Hat Linux 2.6.9
SuSe Linux 2.6.16
Solaris 10, 11

di has been ported to the following systems in the past:

A/UX, AIX, BSDI, Convex, Cray UNICOS 9 & 10, Cray UNICOS/mk, FreeBSD, HP/UX 10.x, 11.x, Linux, MacOS, NetBSD 1.x, 2.x, 3.x, 4.x, Next 3.x, OpenBSD, Compaq Tru64 (Digital Unix; OSF/1), Pyramid, SCO, Sequent Dynix and PT/x, SGI Irix, Solaris, SunOS, Sys V.3, Sys V.4, Ultrix, Windows, Xenix


di License

Copyright 1994-2008 Brad Lanam, Walnut Creek, CA, USA

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

3. This notice may not be removed or altered from any source distribution.


di Manual Page
Name
     di	- disk information

Synopsis
     di	[-AaghHklLmnPtZ] [-b block-size]  [-d  display-size]  [-f
     format]   [-I   include-fstyp-list]   [-s	 sort-type]   [-w
     block-width] [-W inode-width]  [-x	 exclude-fstyp-list]  [-X
     debug-level] [-z zone-name] [file [...]]

     mi

Description
     di	Displays usage information on mounted filesystems.  Block
     values  are  reported in megabytes	(1024k bytes) by default,
     but may be	changed.  If file is specified,	the usage  infor-
     mation  for  the  partition  on  which  file  is  located is
     printed.

     Unless the	-a  flag  is  specified,  the  following  mounted
     filesystems will not normally be displayed: filesystems with
     total blocks <= 0;	filesystems marked by the operating  sys-
     tem as "ignore"; automounted filesystems that are duplicates
     of	other normally mounted filesystems; loopback  filesystems
     that are part of a	zone (Solaris).

     mi	Displays the mounted filesystem	information.

     Several switches may be specified to control the  output  of
     di	and mi:

     -A	  Print	all fields (used for  debugging).   Mount  points
	  and  special	device	names  are printed at full width.
	  The -a flag is set.

     -a	  Prints all mounted  devices  (normally,  those  with	0
	  total	  blocks   are	not  printed  -	 e.g.  /dev/proc,
	  /dev/fd).

     -b	  block-size (compatibility: -B)
	  Change the base block	size from 1024 (default)  to  the
	  size	specified.   block-size	 may  be one of: k - 1024
	  bytes, d - 1000 bytes, or a specific size.

     -d	  display-size Display the blocks in units  specified  by
	  display-size.	 display-size may be one of: 512 - POSIX,
	  k - kilobytes,      m	- megabytes,	   g - gigabytes,
	  t - terabytes,       P - petabytes,	    E -	exabytes,
	  Z - zettabytes, Y - yottabytes, h - Scaled  alternative
	  1, H - Scaled	alternative 2, or a specific value to use
	  as the block size.

	  Block	 display  sizes	 greater  than	1024  bytes   are
	  displayed  with  a precision of one decimal place after
	  the radix.

	  The Scaled alternatives scale	the sizes  displayed  and
	  appends a suffix (e.g. 48.0k,	3.4M).

	  With scaled alternative 1,  sizes  within  a	line  may
	  scale	to different units.

	  Scaled alternative 2 scales all the sizes in each indi-
	  vidual line to the same unit size (the largest needed).

     -f	  format Use the specified format string format.   Format
	  strings are described	below.

     -g	  (alias for: -dg)
	  Display sizes	in gigabytes.

     -h	  (alias for: -dh)
	  Display partition sizes in scaled alternative	1 format.

     -H	  (alias for: -dH)
	  Display partition sizes in scaled alternative	2 format.

     -I	  include-fstype-list (compatibility: -F)
	  Include  only	 the  file   system   types   listed   in
	  include-fstyp-list.  The list	is a comma separated list
	  of file system  types.   Multiple  -I	 options  may  be
	  specified.  e.g. -I nfs,rfs or -I nfs	-I rfs.

     -k	  (alias for: -dk)
	  Display sizes	in Kbytes.

     -l	  Display only local file systems.

     -L	  Don't	do the check for duplicate filesystems.

     -m	  (alias for: -dm)
	  Display sizes	in megabytes.

     -n	  Do not print a header	line above the list of file  sys-
	  tems.	 Useful	when parsing the output	of di.

     -P	  Output format	is POSIX standard.  512	byte  block  size
	  is the default.  The -k option may be	used.

     -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  special  device
	  name;	 t  -  by  filesystem  type; r - reverse the sort
	  order.

	  These	sort options may be combined in	any order.  e.g.:
	  di -stsrm; di	-strsrm.

     -t	  Print	a totals line below the	 list  of  file	 systems.
	  Memory  filesystems (tmpfs, mfs) and read-only filesys-
	  tems are not added to	the totals.

     -w	  block-width
	  Set the print	 width	for  block  values.   Default  is
	  eight.

     -W	  inode-width
	  Set the print	 width	for  inode  values.   Default  is
	  seven.

     -x	  exclude-fstype-list (old: -i)
	  Exclude   the	  file	  system    types    listed    in
	  exclude-fstyp-list.  The list	is a comma separated list
	  of file system  types.   Multiple  -x	 options  may  be
	  specified.  e.g. -x nfs,rfs or -x nfs	-x rfs.

     -X	  level
	  Set the program's debugging level to debug-level.

     -z	  zone-name
	  Display the filesystems for the  specified  zone.   The
	  zone must be visible to the user.

     -Z	  (alias for: -z all)
	  Display the filesystems for all visible 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	switch or
     by	the DIFMT environment variable.	 The  format  string  may
     specify the following columns:

     m	  Print	the name of the	mount point.

     M	  Print	the name of the	mount point, at	full length.  The
	  mount	point is formatted to the maximum width	necessary
	  for the longest mount	point name.

     b	  Print	the total number of megabytes on the file system.
	  See also the -d option.

     B	  Print	the total number of megabytes on the file  system
	  available  for  use  by  normal users.  See also the -d
	  option.

     u	  Print	the number of megabytes	in use on the file system
	  (actual  number of megabytes used = total - free).  See
	  also the -d option.

     c	  Print	the number of megabytes	not available for use  by
	  normal  users	 (total	 -  available).	  See also the -d
	  option.

     f	  Print	the number of free (unused) megabytes on the file
	  system.  See also the	-d option.

     v	  Print	the number of megabytes	available for use by nor-
	  mal users.  See also the -d option.

     p	  Print	the percentage of megabytes not	available for use
	  by  normal users (number of megabytes	not available for
	  use /	total disk space).  See	also the -d option.

     1	  Print	the percentage of total	megabytes in use  (actual
	  number of megabytes used / total disk	space).	 See also
	  the -d option.

     2	  Print	the percentage of megabytes  in	 use,  BSD-style.
	  Represents  the  percentage  of user-available space in
	  use.	Note that values over 100% are	possible  (actual
	  number  of  megabytes	 used  /  disk space available to
	  non-root users).  See	also the -d option.

     a	  Print	the percentage of megabytes available for use  by
	  normal  users	 (number of megabytes available	for use	/
	  total	disk space).  See also the -d option.

     3	  Print	the percentage of total	 megabytes  free  (actual
	  number of megabytes free / total disk	space).	 See also
	  the -d option.

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

     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.

     s	  Print	the file system	name (special  device  or  remote
	  mount	point).

     S	  Print	the file system	name (special  device  or  remote
	  mount	 point), at full length.  The file system name is
	  formatted to the maximum width necessary for the  long-
	  est file system name.

     t	  Print	the file system	type.

     T	  Print	the file system	type at	full  length.	The  file
	  system type is formatted to the maximum width	necessary
	  for the longest file system type.

     I	  Print	the time the filesystem	was mounted.  This column
	  is not supported on all systems.

     O	  Print	the filesystem mount options.

     The default format	string for di is smbuvpT.

     The default format	string for mi is MSTIO.

     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
     (Bourne Shell):
	  di -f	'mbuvp
	  miUFP'
     will print	two lines of data for each filesystem.

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

	  /usr/bin/df -v     di	-P -f msbuf1
	  /usr/bin/df -k     di	-dk -f sbcvpm
	  /usr/ucb/df	     di	-dk -f sbuv2m

     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 Variables
     The DIFMT environment variable may	be used	 to  specify  the
     default display format string.

     The DI_ARGS environment variable may be used to specify com-
     mand  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.

Note
     For filesystems that do not report	 available  blocks  (e.g.
     System  V release 3), the number of available blocks is con-
     sidered to	be the number of free blocks.

WARNING
     Do	not replace your system's df command with  this	 program.
     You  will	in  all	 likelihood  break your	installation pro-
     cedures.

See Also
     df(1),  fstab(5),	 getmnt(2),   getmntinfo(2),   mnttab(4),
     mount(1M) statfs(2), statvfs(2)

Bugs
     Send bug reports to: bll6969di_at_gmail.com

Website
     http://www.gentoo.com/di/

Author
     This program is Copyright 1994-2008 by Brad Lanam.

     Brad Lanam, Walnut	Creek, CA (bll6969di_at_gmail.com)
  

Kudos for di:

di version 1.18 was written up in HP-UX/USR. November 1995.

Linux Journal. April 2002.

Linux Village (Hungarian) [PDF]. September 2002.

Linux User (German). January 2004.

Debian Administration. May 2005.

Linux User (German). May 2007.

Nice program.

Cool program.

Nice package.

I just grabbed di from news and it looks great, ... Thanks for starting what will be one of the great sysadmin tools

Thanks for a great tool!

If I may add my $.02 to your efforts (which I find rather exceptional, IMHO)...

BTW, nice program. Thanks for writing it.

Thank you thank you thank you for the code,... Again, many thanks for posting the code.

Great Utility! I love being able to specify the format of the output via commandline. Again, thanks for a great toy!

Many thanks for your efforts!!

Thanks very much for your efforts on di.

First of all you wrote an excellent utility....

It's great to have a Sun-like df again. Thanks!

(By the way, I stopped using 'df', since I installed 'di'. I like it.)

'di' looks nice and will see much use here at 'liedus'.

Thanks for a new tool. ... Thanks again for a nifty file,

Thanks for this neat tool,

Great tool!

Thanks for maintaining diskinfo! I find it *very* useful since I administer many different platforms.

Thanks for the di command. It looks really useful.... Thanks again for the very useful program.

Neat program, compiled first time, no errors, and it works great.

Hi! I use your "di" program. It is great! Now I can have consistent reports of disk usage no matter what platform I am on. I use it on HP-UX, SunOS, IRIX, Ultrix, so far. Thanks a lot.

Great tool. We find it far more functional than even GNU df. Keep up the good work..