Disk Is Full? How to Find Large Files on Linux (Beginner Friendly Guide)
# Step 1 — Check Disk Usage Overview
Start by checking which partition is full:
Example output:
-
Use% = 95% → This partition is almost full
-
Focus cleanup here
## Step 2 — Identify Which Directories Use the Most Space
Use du (disk usage) command:
Explanation:
-
du -h→ human-readable sizes -
--max-depth=1→ show top-level folders only -
sort -hr→ sort from largest to smallest
Example output:
-
/varis the biggest folder → check inside
## Step 3 — Drill Down into Large Directories
Go into the largest folder, e.g., /var:
Common culprits:
-
/var/log→ large log files -
/var/cache→ package caches -
/var/lib/mysql→ databases -
/var/tmp→ temporary files
## Step 4 — Find Individual Large Files
To locate files bigger than, for example, 500MB:
Explanation:
-
-type f→ only files -
-size +500M→ bigger than 500MB -
ls -lh→ human-readable size -
awk→ print file path and size
This gives a clear list of huge files to review.
## Step 5 — Use ncdu for Easier Navigation
ncdu is an interactive tool to explore disk usage.
Install:
Run:
-
Navigate with arrow keys
-
Identify large directories and files easily
-
Delete safely from within ncdu using
dkey
## Step 6 — Check Log Files
Logs can grow very fast. Check /var/log:
Common large log files:
-
syslog -
auth.log -
mysql/error.log -
apache2/access.log
Clean logs safely:
## Step 7 — Clean Package Cache
Package managers often store old packages in cache:
Debian/Ubuntu
CentOS/RHEL
Fedora
## Step 8 — Remove Old Kernels (Debian/Ubuntu)
Old Linux kernels can take GBs of space:
## Step 9 — Check User Home Directories
Sometimes users store huge files in /home:
Delete or move unnecessary large files to external storage or cloud.
## Step 10 — Set Up Disk Monitoring
To prevent future disk-full situations:
-
Install monitoring tools: Netdata, Glances, or Grafana + Prometheus
-
Schedule automated cleanup: cron jobs for
/tmpor/var/cache -
Alert when disk usage > 80%
Example cron job to clean temp files:
Deletes files older than 7 days daily at 3AM.
## Beginner-Friendly Checklist
| Issue | Diagnosis | Fix |
|---|---|---|
| Partition almost full | df -h | Focus cleanup on this partition |
| Largest directories | du -h --max-depth=1 / | Drill down and identify culprit |
| Large individual files | find / -type f -size +500M | Delete or move |
| Log files | /var/log | Truncate or rotate |
| Package cache | apt/yum clean | Free space safely |
| Old kernels | dpkg --list + apt autoremove | Remove old kernels |
| User files | /home | Move or delete unnecessary files |
## Conclusion
A full Linux disk doesn’t have to be scary. By systematically checking:
-
Disk usage by partition
-
Largest directories
-
Individual large files
-
Logs, caches, old kernels, and user files
You can reclaim gigabytes of space safely. Use ncdu for interactive cleaning, set up monitoring, and schedule regular maintenance to prevent the disk from filling up again.