Skip to content

Find the twenty largest files on the drive in one command

Explorer search, a PowerShell one-liner and the elevation detail that decides whether the answer is complete or quietly short.

5 min read

Two questions get confused constantly. Which files are largest is answered below in one line. Which folder is largest is a different question with a different tool, because a folder of forty thousand small files never appears in a list of large files and can still be the reason the drive is full.

Explorer, with the search syntax nobody documents

Type this in the search boxFinds
size:giganticFiles over 4 GB
size:huge128 MB to 4 GB
size:>1GBAnything over 1 GB
size:>500MB datemodified:<01/01/2025Large and old, together
ext:iso OR ext:vhdxThe file types that are usually the largest

Switch to Details view and add the Size column, then sort by it. Explorer's search leans on the index, so results in indexed locations appear immediately and unindexed ones trickle in, which is covered in the search index.

PowerShell, which does not depend on the index

# The twenty largest files anywhere on C. Run elevated.
Get-ChildItem C:\ -Recurse -File -Force -ErrorAction SilentlyContinue |
  Sort-Object Length -Descending | Select-Object -First 20 `
    @{n='GB';e={[math]::Round($_.Length/1GB,2)}}, LastWriteTime, FullName

Without elevation this misses every folder your account cannot read and reports no error, because -ErrorAction SilentlyContinue is what stops it stopping. The result looks complete and is not, which is the single most common way this command misleads people.

# Largest per extension, which usually names the culprit faster
Get-ChildItem C:\Users -Recurse -File -Force -EA SilentlyContinue |
  Where-Object Length -gt 50MB |
  Group-Object Extension |
  Select-Object Name, Count, @{n='GB';e={[math]::Round(($_.Group | Measure-Object Length -Sum).Sum/1GB,2)}} |
  Sort-Object GB -Descending | Select-Object -First 12

What the answers usually are

FileTypical sizeCovered in
pagefile.sys1 to 16 GBThe page file
hiberfil.sysAround 40 percent of memoryThe hibernation file
*.vhdx, *.vdi, *.vmdk20 to 200 GBVirtual machine disks
*.iso4 to 9 GB eachUsually in Downloads
Video exports and camera files1 to 50 GBCreative work

The single files that come top of the list are rarely the interesting answer, because most of them have to exist. The folder totals are where the recoverable space is, and that is what what is actually filling the C drive walks through.

For a picture rather than a list, a treemap makes the shape obvious in a way a sorted list cannot: TreeSize, WizTree and WinDirStat compared.

Common questions

How do I find the largest files on Windows?

In Explorer, search the drive for size:gigantic or size:>1GB and sort by the Size column. In PowerShell, list files recursively and sort by Length, running elevated so nothing is silently skipped.

Why does my file search miss some files?

Two reasons. Explorer's search depends on the index in some locations, and a PowerShell walk without elevation skips every folder your account cannot read while reporting no error.

What does size:gigantic mean in Windows search?

It is Explorer's built-in filter for files over 4 GB. size:huge covers 128 MB to 4 GB, and size:>500MB works for an explicit threshold.

Why is my drive full when I have no large files?

Because thousands of small files add up. Build output, caches and package folders are made of tiny files, so they never appear in a search for large ones.

Read next