zjffun blog

Free disk space

更新于 写于 LinuxDebian

ncdu

Ncdu is a disk usage analyzer with an ncurses interface.

bash
sudo apt-get install -y ncdu

ncdu /

Analyze command

bash
# Check disk space
df -h

# Show files size larger than 100M
find . -type f -size +100M

# Show sorted folders size
du -hd1 | sort -h

Some safe commands

bash
# Clean the apt cache
sudo apt clean

# Delete old log files
sudo find /var/log -type f -name "*.gz" -delete

# Delete unused docker images
docker image prune

See also