By Greg Nowak. Last updated 2026-11-21.
A disk usage analyser helps you see which files and folders occupy the most space. That is useful when a workstation fills up, a website approaches its hosting limit, or an agency needs to understand why a project’s storage keeps growing.
Start by finding where the space has gone. Then establish what those files do and who owns them. A large backup, media library or database may be entirely legitimate; deleting it because it tops the list is a poor maintenance strategy.
For a Linux desktop, QDirStat gives you a visual overview. For a remote server, ncdu provides an interactive terminal view. Here is how to choose between them and turn the findings into a sensible cleanup plan.
Choose a tool that fits your access
| Your situation | Start with | What it helps you do |
|---|---|---|
| You have a Linux desktop and want a visual overview | QDirStat | Spot large files in a treemap and explore their parent folders. |
| You connect to a server through SSH | ncdu | Browse directory sizes interactively without a graphical desktop. |
| You need a quick directory ranking | du and sort | Produce a readable list using GNU command-line tools. |
| You need to confirm which filesystem is filling up | df | Check available capacity before investigating individual folders. |
Use QDirStat to make large files visible
QDirStat displays directory totals in a tree alongside a coloured treemap. Larger rectangles represent larger files, while colours distinguish file types. Selecting a rectangle identifies the corresponding file in the directory tree.
Open the project folder, home directory or storage location you want to investigate. Look for both individual large files and folders containing many smaller ones. A single video export is easy to spot; a collection of generated images may need a closer look at the directory totals.
For business owners and project leads, this makes a storage discussion more concrete. Instead of “the server needs more space”, you can ask whether the growth comes from customer uploads, retained exports or something else. QDirStat includes cleanup actions, so treat the first pass as an inspection and review files before using those actions.
Check the affected filesystem first
On a GNU/Linux system, run these commands from the directory you are investigating:
df -h .
df -i .The first shows capacity and available space on the filesystem containing the current directory. The second shows inode usage: another useful check when a filesystem holds very large numbers of small files. These options are documented in the GNU df manual supplied by Debian.
Check the location carefully. Removing files from one mounted filesystem will not free capacity on another. Record the starting figures so you can verify the effect of any cleanup later.
Find the biggest directories from the terminal
For a quick overview, this GNU/Linux command lists the current directory and its immediate subdirectories, largest first:
du -xh --max-depth=1 . | sort -hrIn the GNU du manual, -x limits the scan to one filesystem, -h makes sizes readable, and --max-depth=1 limits the displayed directory levels. Hidden directories are included because the scan starts at .. GNU sort uses -h to understand size suffixes and -r to reverse the order.
The entry for . is the overall total, including files directly inside it. Directory totals include their descendants, so do not add the rows together. Move into a large subdirectory and repeat to narrow the search.
This replaces the original article’s longer find | xargs | du pipeline, which repeatedly scanned overlapping directory trees. The simpler command handles spaces in names, but its line-based output is for inspection: filenames containing newlines can still be confusing. Use an interactive browser for those cases, and do not feed this output into a deletion command.
Use ncdu when working over SSH
Install ncdu through your operating system’s package manager, then start an inspection with:
ncdu -rr -x .The current ncdu manual documents repeated -r flags as disabling both deletion and shell spawning. The -x option keeps the scan on the starting filesystem. Browse into the largest directories to identify what is taking space.
Choose the starting directory deliberately: a separately mounted uploads or backup volume needs its own scan. Permission errors also mean the picture is incomplete. Ask the system owner to inspect restricted locations rather than assuming an unreadable directory is empty. On busy production systems, arrange broad scans for a quieter period.
Turn the findings into a maintenance decision
For each cleanup candidate, establish its purpose, owner and recovery route. Confirmed temporary exports may be removable. Backups need an agreed retention policy and a checked recovery copy. Application caches should be cleared through the application’s supported process. Database files and active service data need the responsible administrator’s attention.
After cleanup, rerun the capacity check and directory scan. Record what changed, then address the cause: retention settings, recurring exports, log management or expected business growth. Extra storage may be the right purchase when the data is useful and growing predictably.
If storage problems keep returning across your websites or agency projects, Greg can help coordinate the investigation, clarify responsibilities and agree a practical maintenance plan. Get in touch with the affected system and what you have found so far.
Related on GrN.dk
- How to Delete Files and Folders Older Than X Days in Linux
- Apache 2.4.68: What to Check Before You Call It Patched
- Bash: Find and Delete Files Older Than X Days
Need help with this kind of work?
Discuss your storage and maintenance needs Get in touch with Greg.