Skip to content

Instantly share code, notes, and snippets.

@bindiego
Last active August 29, 2015 14:06
Show Gist options
  • Save bindiego/58a70261ae02edebdcf9 to your computer and use it in GitHub Desktop.
Save bindiego/58a70261ae02edebdcf9 to your computer and use it in GitHub Desktop.
Shell scripts that are useful to clear your system.
#!/bin/sh -ex
##################
# Author: Bin Wu #
##################
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