How to unload kernel modules

kernelkernel-extensions

When I run kextstat, it gives me a list of the currently loaded kernel modules. How to I go about using the information gathered from this command to unload a kernel module?

Best Answer

You can unload kernel modules with kextunload either specifying the whole path to the kernel extension as a parameter (they reside in /System/Library/Extensions/) or by specifying the bundle identifier displayed by kextstat, e.g. if you want to unload Fuse for OS X:

sudo kextunload -b com.github.osxfuse.filesystems.osxfusefs

You can then use kextload for loading extension in the same way.

Bonus hint: If you only want to see 3rd party kernel extensions that aren’t from Apple you can use inverse grep:

kextstat | grep -v com.apple