dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purgeBeware!! sometime older karnel may be very important if there is any problem found in newer karnel.
Remove unnecessary karnel from ubuntu
After installing Ubuntu, day by day it update karnel. Older karnels are not uninstall automatically. So older karnels are remain in harddisk and block space. If you want to remove older karnels from your system just use this command below in terminal mode. This command should be use in 'superuser'