The popular open-source contract for web designers and developers by Stuff & Nonsense
- Originally published: 23/12/2008
- Revised date: 15/12/2013
- Original post
| #!/bin/bash | |
| # Ubuntu kernel cleanup: | |
| # Save the 2 latest kernels and remove the old | |
| IMAGES=($(dpkg --get-selections | grep "linux-image-[[:digit:]].*" | tr "\t" ";" | cut -d ";" -f1)) | |
| HEADERS=($(dpkg --get-selections | grep "linux-headers-[[:digit:]].*" | tr "\t" ";" | cut -d ";" -f1)) | |
| I_LEN=${#IMAGES[@]} | |
| H_LEN=${#HEADERS[@]} |