Last active
October 26, 2024 03:57
-
-
Save lemajes/e15045da9dba767477b7d7ff8d819a2d to your computer and use it in GitHub Desktop.
[Clean old kernels] Script to deleted unused kernels and free disk space
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
#!/bin/bash | |
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get purge -y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment