Last active
November 24, 2015 10:03
-
-
Save ggrandes/c12131a78e960166f4a0 to your computer and use it in GitHub Desktop.
Old Kernel Autoclean (Ubuntu)
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 | |
# In New Ubuntu Versions: | |
# apt-get -y autoremove | |
uname -a | |
ls -al /boot/vmlinuz-* | |
sudo aptitude -y purge $(ls -1 /boot/vmlinuz-* | grep -v ".efi." | grep -v -e $(uname -r) | sort | head -n -1 | sed -e 's|/boot/vmlinuz|linux-image|g') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment