There are several ways to view the Linux kernel parameters for the currently booted system:
- The
sysctl
command can be used to view and modify kernel parameters at runtime. To view all kernel parameters, use the-a
option.
sysctl -a
- The
/proc/sys/
directory contains files representing kernel parameters. You can view the contents of these files to see the current values of the parameters. For example, to view the current value of the kernel’s maximum shared memory segment size, you can use the command:
cat /proc/sys/kernel/shmmax
- Another way is to use the
cat
command to view the contents of the/proc/cmdline
file. This file contains the kernel command line arguments used during boot.
cat /proc/cmdline
- You can also use the
dmesg
command which prints the kernel ring buffer. It contains the kernel boot messages and kernel log messages, which includes kernel parameters passed during boot. (takes2fitness)
dmesg | grep -i "kernel command line"
Note that some kernel parameters may not be visible in the above methods, as they are built into the kernel binary and may not be modified at runtime.