Last active
November 2, 2022 06:05
-
-
Save lorne-luo/059e50ef86a89620ac4cec95dee27fc6 to your computer and use it in GitHub Desktop.
linux cleanup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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