Skip to content

Instantly share code, notes, and snippets.

@gphan
Created May 31, 2013 04:24
Show Gist options
  • Save gphan/5682934 to your computer and use it in GitHub Desktop.
Save gphan/5682934 to your computer and use it in GitHub Desktop.
Cleans old kernel images from Ubuntu Server 12.04
#!/bin/bash
dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | xargs sudo apt-get -y purge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment