Thursday, June 28, 2012

Do You D U? Utility Reminder of the Day: Disk Usage (DU.exe)

To BizTalk and Beyond! - Disk Usage (DU.exe): Wish there was a Like button

"My d:\ drive holds my Hyper-V virtual machines and their associated .VHD files. Well, out of 463 GB I got down to 34 GB free. Only in a VM-world can I fill 429 GB. Windows displays the disk in a lovely shade of red that I'm sure is yelling at me.

My goal is to see the directories and their file sizes. I remember doing this "back in the day", possibly on a Windows 2003 server. And, I know I used a SysInternals tool. So today I repeat what I did several years ago, which is to use Disk Usage (DU.exe) from SysInternals:

  1. On my Hyper-V server, download Disk Usage from SysInternals: It's a command line tool in zipped file. Extract it somewhere easy :).
  2. Open a command prompt as Administrator and go to this folder.
  3. Type: du.exe -v d:\ > Output.txt

Output.txt is created in the same folder as DU.exe. My output, minus the 0 byte directories:


While it isn't as pretty as utilities like WinDirStat or the other like utilities, sometimes you just need something simple, easy, quick and command line driven.

Image you want a quick and dirty way to track a folder growth over time? Schedule this, use the -c parameter and ingest the results and bang, you're done. Or use this to find 0 byte folders. Or... or.. or...

du.exe /?

Du v1.4 - report directory disk usage
Copyright (C) 2005-2011 Mark Russinovich
Sysinternals -

usage: du.exe [-c] [-l <levels> | -n | -v] [-u] [-q] <directory>
   -c     Print output as CSV.
   -l     Specify subdirectory depth of information (default is all levels).
   -n     Do not recurse.
   -q     Quiet (no banner).
   -u     Count each instance of a hardlinked file.
   -v     Show size (in KB) of intermediate directories.


Related Past Post XRef:
WinDirStat (Drive Usage Analysis/Treemap Utility)

No comments: