Skip to content

Q&A · Answered

How to check disk usage and find large files on Linux

asked 9 months, 1 week ago 1645 views 1 answer
7

My server disk is getting full. How can I find which files and directories are taking up the most space?

1 Answer

One accepted
27

Accepted answer

Not confirmed since it was written, 9 months, 1 week ago

Check overall disk usage

# Human-readable disk usage
df -h

# Show only local filesystems
df -hl

Find large files and directories

# Find top 10 largest directories
du -h --max-depth=1 / | sort -hr | head -10

# Find files larger than 500MB
find / -type f -size +500M -exec ls -lh {} \;

# Interactive disk usage analyzer
sudo apt install ncdu
ncdu /

Your answer

Say what you tried, not only what worked — the next person needs the reasoning. Code goes in a fenced block.

Shown beside your answer and never checked, so it cannot be a name someone already has here.

No account needed to answer. Sign in instead and it carries your name and earns reputation.