General Disk Commands
Disk usage overview
df -hFind directories containing the most space
sudo du -xh / --max-depth=1 | sort -h
sudo du -xh /var/lib --max-depth=1 | sort -hDocker
Remove docker images
docker rmi <img1> <img2> ...Prune images not referenced by containers
docker image prunePrune all unused images (dangling + unreferenced)
docker image prune -aCheck docker volume usage
sudo du -sh /var/lib/docker/volumes/*Check if a volume is in use
docker ps --filter volume=<volume-name>Prune only unused volumes
docker volume pruneCheck docker disk usage
docker system dfClear docker build cache
docker builder pruneSafe-ish cleanup routine
docker container prune
docker image prune -a
docker volume prune
docker network prune
docker system df
💡
I work at Microsoft, but the views expressed here are my own and do not represent Microsoft's official positions, guidance, or content.