Disk Usage Analyzer for Linux: Find Big Files
Linux gives you the best disk tools of any platform โ and most of them are already installed. The problem is the output: du and df answer accurately but tersely, and a GUI file manager hides folder sizes entirely. Here is how to get from "disk 92% full" to "this folder is 40 GB", with the built-in commands, a terminal analyzer, and the GUI tools that make the whole tree clickable.
Start with df โ the big picture
Before you measure a single folder, check which filesystem is actually full. Linux often splits one disk into several mounts โ /, /home, /var, /tmp โ and df -h shows each one:
df -h
df -i
df -h reports sizes in human units. df -i reports inodes, not bytes: on mail servers, Docker hosts and machines with millions of tiny files you can exhaust inodes while the disk still shows gigabytes free. If the IUse% column is near 100%, that is your problem โ not file size.
du โ measure a folder
du adds up a folder's contents. The flags that make it fast and readable:
du -xhd1 / | sort -hr | head -20
du -sh ~/.cache ~/.local/share ~/Downloads
-xstays on one filesystem, sodu /does not wander into mounted disks and network shares.-d1limits output to one level of subfolders โ the top-level view that usually names the culprit.-hprints human-readable sizes; drop it if you want to sort numerically.- Piping through
sort -hrandheadkeeps only the largest entries.
Run the same command again on whichever folder comes out on top, and repeat. Three or four levels are usually enough to find the 40 GB directory you forgot about.
ncdu โ the terminal analyzer
ncdu is an interactive terminal UI that scans once and then lets you browse the tree with arrow keys, sort by size, and delete files directly. Install it from your package manager, then point it at the folder to scan:
sudo apt install ncdu
ncdu /
gdu is a faster Go reimplementation with the same idea; duf is a prettier df. All three run over SSH, which makes them the answer for a headless server you cannot put a GUI on.
GUI analyzers for Linux
| Tool | Desktop | Price | Best for |
|---|---|---|---|
| DiskRaptor | GNOME, KDE, any | Free, open source | Tree + treemap + 3D view, duplicates, S.M.A.R.T., cross-platform |
| GNOME Disk Usage Analyzer (baobab) | GNOME | Free, open source | Simple ring and treemap view |
| Filelight | KDE Plasma | Free, open source | Radial map, KDE-native |
| ncdu / gdu | Terminal | Free | Servers, SSH, no GUI available |
| duf | Terminal | Free | Colored df replacement |
A native GUI analyzer has one advantage over the terminal: it aggregates the whole disk once and lets you sort and filter instantly โ by size, by file type and by age. That is how you find the 80 GB of Docker layers that du buries three levels deep.
The usual Linux space hogs
| Location | What it is | Typical size |
|---|---|---|
| ~/.cache | Browser, app and thumbnail caches | 2โ30 GB |
| /var/lib/docker | Docker images, containers, volumes | 10โ200 GB |
| /var/log | System and service logs | 1โ20 GB |
| /var/lib/snapd + ~/snap | Snap packages and their data | 2โ30 GB |
| ~/.local/share/flatpak | Flatpak apps and runtimes | 2โ50 GB |
| /var/cache/apt | Downloaded .deb packages | 1โ10 GB |
| ~/.local/share | App data, including Steam and browser profiles | 5โ100 GB |
Delete safely on Linux
- Never delete from
/usr,/lib,/bootor/etcby hand โ uninstall through the package manager instead. - Clear the package cache with
sudo apt clean(orautoremovefor orphaned packages). - Shrink logs with
journalctl --vacuum-size=500Mrather than deleting files in/var/log. - Reclaim Docker space with
docker system pruneโ it removes unused images, containers and build cache. - When in doubt, move the folder to another disk instead of deleting it.
Frequently asked questions
Why does du show less used space than df?
Two reasons. Files a running process still has open are invisible to du until the process exits โ a deleted log still being written by a service is the classic case. The filesystem also reserves blocks you cannot see. Restart the process (or reboot) and the numbers converge.
Is /var/lib/docker safe to delete?
No โ that is where your images and volumes live. Deleting it by hand removes everything Docker knows. Use docker system df to see what is using space and docker system prune to remove only what is unused.
Can I run a disk analyzer on a headless server?
Yes. ncdu or gdu run over SSH and give you a browseable, sortable view with no GUI required. If you want a report you can copy, run du or DiskRaptor's export on the server and pull the file.
Do I need a GUI analyzer at all?
No โ the terminal tools are fully capable. A GUI earns its place when you want to click through the tree, filter by file type, and see a visual map (treemap or galaxy view) of the whole disk at once.
Local scan, private connection
Disk analysis should stay on the machine โ DiskRaptor never uploads anything. Give your browsing the same treatment: a VPN for untrusted networks, antivirus for what you download, and an ad blocker for the trackers between you and the pages you read.
Affiliate disclosure: the links below are affiliate links. If you buy through them, we may earn a commission at no extra cost to you โ it helps keep DiskRaptor free.
More about our Surfshark partnership.
Related reading
- Best Free Disk Space Analyzer (2026)
- Disk Usage Analyzer for Mac
- Scan a Huge Drive Fast
- What Is a Disk Space Analyzer?
Reclaim your disk space
DiskRaptor is free, open source, and runs 100% locally.