Skip to content

Instantly share code, notes, and snippets.

@lorne-luo
Last active November 2, 2022 06:05
Show Gist options
  • Save lorne-luo/059e50ef86a89620ac4cec95dee27fc6 to your computer and use it in GitHub Desktop.
Save lorne-luo/059e50ef86a89620ac4cec95dee27fc6 to your computer and use it in GitHub Desktop.
linux cleanup
# To delete downloaded packages
sudo apt-get clean
# To remove all stored archives in your cache for packages
sudo apt-get autoclean
# To remove unnecessary packages
sudo apt-get autoremove
# check kernel version can remove
dpkg --get-selections | grep linux-image
# To delete old kernel versions
sudo apt-get remove --purge linux-image-X.X.XX-XX-generic
# Show top 10 biggest subdirs in the current dir.
sudo du -sh * | sort -nr | head -10
cd /
sudo du -h --max-depth=1
# docker
# cleans up dangling images
docker image prune
docker container prune
docker volume prune
docker network prune
docker system prune
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment