Guide to Unix/Commands/Kernel Commands

From Wikibooks, open books for an open world
< Guide to Unix‎ | Commands
Jump to: navigation, search

lsmod[edit]

lsmod lists the modules loaded by the Linux kernel.

modprobe[edit]

modprobe loads a Linux kernel module. You can specify only the name of the module, and modprobe will load it from the correct location and also load any dependent modules.

Many modules load automatically. For example, Linux loads a USB keyboard module when a USB keyboard is attached. It also loads the base USB modules as dependencies. Some modules must be loaded manually, and "modprobe" is the easiest way to do this.

sysctl[edit]

sysctl sets a parameter to change the behavior of the kernel. The available parameters vary by kernel, so check the man page for sysctl in your distribution.

Examples:

Check the setting for the "vm.swapencrypt.enable" parameter:

$ sysctl vm.swapencrypt.enable
vm.swapencrypt.enable=0

Root can set the parameter to 1.

$ sysctl vm.swapencrypt.enable=1
vm.swapencrypt.enable: 0 -> 1