Is there du in Windows?

Answer: Yes there is! Prodigy Mark Russinovich wrote the Windows counterpart of UNIX’s indispensable du command called, uhm, du:

Copy du.exe to %Windir%/System32. (The /usr/bin equivalent of Windows).

To obtain the size of top level subdirectories in a directory, with the largest on first in Bash@Linux, we type:

du --max-depth=1 | sort -r

The equivalent for Powershell@Windows would be:

du -q -l 1 | sort -descending

What I would really like to see is Mark’s du.exe be able to return directory sizes in well, “human readable formats”: KiB, MiB, GiB, TiB etc etc. In UNIX’s du, the argument -h does the job.

2 thoughts on “Is there du in Windows?”

  1. I also use the -v option in du.exe. Unfortunately that gives period in the numbers. How to still get it in the right order then?

    Thanks in advance.

  2. du -q -l 1 | sort -descending
    this gives an error:
    -descendingThe system cannot find the file specified.

    Instead of this, try:
    du -q -l 1 | sort

Leave a Reply