Skip to content

Instantly share code, notes, and snippets.

@ursm
Created October 22, 2010 01:33
Show Gist options
  • Save ursm/639748 to your computer and use it in GitHub Desktop.
Save ursm/639748 to your computer and use it in GitHub Desktop.
kclean
#!/bin/bash
for path in /usr/src/linux-*; do
version=${path#*/linux-}
if qfile $path > /dev/null; then
echo "$version: skip"
else
echo "$version: removing"
cmd="rm -rf $path /lib/modules/$version /boot/*-$version /boot/*-$version.old"
echo "$cmd"
$cmd
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment