How to check disk usage and find large files on Linux
Answered
7
My server disk is getting full. How can I find which files and directories are taking up the most space?
W
Asked by
web_developer
Platinum
•
285 rep
1 Answer
27
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 /
P
Platinum
•
447 rep
Your Answer
You need to be logged in to answer questions.
Log In to Answer