Professional Documents
Culture Documents
Sysctl Command in Linux: Using To View The Kernel Parameters
Sysctl Command in Linux: Using To View The Kernel Parameters
Swappiness is a Linux kernel property that defines how often the system will
use the swap space .
The sysctl command reads the information from
the /proc/sys directory. /proc/sys is a virtual directory that contains file objects
that can be used to view and set the current kernel parameters.
You can also view a parameter value by displaying the content of the
appropriate file. The only difference is how the file is represented. For
example, both sysctl vm.swappiness and cat /proc/sys/vm/swappiness will give the
same output. When using sysctl the directory slashes are replaced with dots
and the proc.sys part is assumed.
Using sysctl to Modify the Kernel Parameters
To set a kernel parameter at runtime run the sysctl command followed by the
parameter name and value in the following format:
sysctl -w parameter=value
If the value contains empty space or special characters, enclose the value in
double-quotes. You can also pass multiple parameter=value pairs in the same
command.
Be extra careful when changing kernel settings on a production system as it
may make the kernel unstable, and you’ll need to reboot the system .
Conclusion
The sysctl command allows you to view and change Linux kernel parameters.