#!/bin/sh set -eu VERSION=$1 find /boot -maxdepth 1 -type f -not -name "*${VERSION}*" \( -name 'System.map*' -or -name 'vmlinuz*' -or -name 'initramfs*' \) -print \ | xargs rm -v echo echo "done."