Features Download Screenshots Blog

โ† Blog

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

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

ToolDesktopPriceBest for
DiskRaptorGNOME, KDE, anyFree, open sourceTree + treemap + 3D view, duplicates, S.M.A.R.T., cross-platform
GNOME Disk Usage Analyzer (baobab)GNOMEFree, open sourceSimple ring and treemap view
FilelightKDE PlasmaFree, open sourceRadial map, KDE-native
ncdu / gduTerminalFreeServers, SSH, no GUI available
dufTerminalFreeColored 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

LocationWhat it isTypical size
~/.cacheBrowser, app and thumbnail caches2โ€“30 GB
/var/lib/dockerDocker images, containers, volumes10โ€“200 GB
/var/logSystem and service logs1โ€“20 GB
/var/lib/snapd + ~/snapSnap packages and their data2โ€“30 GB
~/.local/share/flatpakFlatpak apps and runtimes2โ€“50 GB
/var/cache/aptDownloaded .deb packages1โ€“10 GB
~/.local/shareApp data, including Steam and browser profiles5โ€“100 GB

Delete safely on Linux

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

Reclaim your disk space

DiskRaptor is free, open source, and runs 100% locally.