If you are a Linux system administrator, it is essential to modify the behavior of the default kernel. For example, you can make the Kernel accept an increase in the number of connections. Kernels can operate on the interface between the hardware and the operating system but the user cannot be executable with the kernel.
Basically, sysctl helps to list and modify kernel runtime variables in a Linux system.
Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform related Linux system commands queries.
In this context, we shall look into how to use the sysctl command in Linux.
You can Run sysctl command with option -a:
$ sysctl -a
Run the sysctl command with the kernel you need to test. For example, We will check vm.page-cluster kernel:
$ sysctl vm.page-cluster
If you want to show only the parameter value, add the -n option:
$ sysctl -n vm.page-cluster
For example, We show only those kernels that start with vm:
$ sysctl -a | grep vm
The syntax:
$ sysctl -w parameter=value
For example, We want to set up the value of vm.page-cluster as 2:
$ sysctl -w vm.page-cluster=2
This article covers how to use the sysctl command in Linux through examples. In fact, sysctl is used to modify kernel parameters at runtime. The parameters available are those listed under /proc/sys/. Procfs is required for sysctl support in Linux.