Skip to content

Instantly share code, notes, and snippets.

@newtone
Last active October 5, 2020 11:33
Show Gist options
  • Save newtone/58385cce65bcdef165ce349789faa071 to your computer and use it in GitHub Desktop.
Save newtone/58385cce65bcdef165ce349789faa071 to your computer and use it in GitHub Desktop.
# Remove old kernels
#
alias purge-old-kernels='dpkg -l '\''linux-*'\'' | sed '\''/^ii/!d;/'\''"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'\''/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d'\'' | xargs sudo apt-get -y purge'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment