Get Build Configuration of Currently Running Linux Kernel

Get Build Configuration of Currently Running Linux Kernel

Linux kernel configuration defines which features, drivers, and options were enabled when the kernel was compiled. Viewing the build configuration can help with troubleshooting, verifying enabled modules, or comparing kernel setups. This tutorial explains how to get the build configuration of the currently running Linux kernel.

The kernel build configuration can be retrieved from several standard locations depending on the Linux distribution and how the kernel was packaged or compiled. Availability of these files is not guaranteed across all systems, so paths may vary between distributions.

On many systems, the following locations are commonly used to access the running kernel configuration:

cat /boot/config-$(uname -r)
cat /lib/modules/$(uname -r)/build/.config
zcat /proc/config.gz

Example snippet from the output:

CONFIG_MODULES=y
CONFIG_SMP=y
CONFIG_PREEMPT_DYNAMIC=y
CONFIG_NETFILTER=y
CONFIG_EXT4_FS=y

Leave a Comment

Cancel reply

Your email address will not be published.