1 2 3 4 5 6 7 8
#!/bin/sh echo "Unloading all kernel modules" for i in `lsmod` do mod=`echo $i | cut -d' ' -f1` rmmod $mod 2> /dev/null done