close
close

How to use the DiskUsage command to analyze disk space in Windows

The DiskUsage.exe tool can be used to analyze the contents of any drive or folder in Windows 11. DiskUsage is accessed from the command line and includes many options to filter and refine the file data that can be generated. In certain situations, this can make it much more useful than GUI tools like Storage Sense.


Here’s how to get started using DiskUsage.exe to view and analyze how space is being used on your drives.


View disk usage of any drive or folder

The easiest way to use the DiskUsage command line tool is to get an overview of how space is currently used on almost a drive or folder. We have used the tool on Windows 11, but it is also available on Windows 10.

  1. Run command prompt as administrator. If you need help, see how to run command prompt as administrator.
  2. At the command prompt type disk usage followed by the path to the drive or folder you want to scan.
  3. For example, to view disk usage for the Pictures folder, type: Disk Usage C:\Users\Username\Imagesand press Get into.
    The disk usage command in command prompt
  4. To see the SizeOnDisk number in a human-readable format, for example, KB, MB, or GB, add / hour to the end of the command.
  5. In our example, this looks like Disk Usage C:\Users\Username\Images /h.
    Disk usage date displayed in command prompt

You can use DiskUsage to analyze any folder in the same way. You can even check internal and external drives, including C: drive. Note that scanning a drive like C: will return a large list of files and folders in DiskUsage.

If using DiskUsage.exe seems too complicated, you can easily see how your disk space is being used with Storage Sense.

List all files larger than a specified size

You can refine the data displayed in DiskUsage based on file size. So if, for example, you only want to include files larger than 500MB, you can set it to ignore smaller files.

  1. To only include files above a specific size, you must add the minFileSize option to the command.
  2. As an example: Disk Usage /minFileSize=6553600 C:\Users\UseName\Downloads /h.
  3. This will only look for files in Downloads that are larger than 50MB and then display the disk space that those files take up in that location.
  4. The file size number must be entered in bytes, so you may need to convert MB to Byte using an online conversion tool.

To get a more detailed view of large files, including file name and size, you can use the /or command switch This allows you to list a defined number of the largest files on the drive or folder.

  1. To do this type: Disk Usage C:\Users\Username\Downloads /h /u=15.
  2. The 15 largest files in the Downloads folder will now be listed in the command prompt.
    file data listed in command prompt
  3. You can replace the number with whatever you want to use. For example, to see the top 5 files taking up space, use /u=5.
  4. Be sure to include the / hour option to have the output be in a format that is easy to read.

After you identify what is taking up the most space, you can use any of these methods to delete large files.

Additional DiskUsage Command Options

The DiskUsage tool contains several other useful options that you can use to filter the output. You can filter by file name, show reserved space or the largest directories within the folder.

For example, to filter by file name add /n=installer at the end of the command to only show files that contain the word installer.

You can see a full list of options by typing Disk usage /? and pressing Get into.

A list of DiskUsage options at the command prompt

Analyze disk space with DiskUsage

Many of the available command line tools are extremely useful for maintaining and managing your Windows PC. And as this guide shows, DiskUsage.exe is a powerful alternative to GUI tools like Storage Sense if you really want to dig into how your disk space is being used.