To set sysctl variables on a Linux system, you can use the sysctl
command with the -w
option followed by the variable name and value.
For example, to set the vm.swappiness
variable to 10
, you can use the following command:
sysctl -w vm.swappiness=10
This will set the vm.swappiness
variable to 10
.
It's important to note that you may need to have root privileges to use the sysctl
command to set sysctl variables.
You can also use the sysctl
command to view the current values of sysctl variables. For example:
sysctl vm.swappiness
This will display the current value of the vm.swappiness
variable.
For more information about using the sysctl
command, you can refer to the sysctl
manual page or use the --help
option. For example:
man sysctl
sysctl --help
It's also important to note that you may need to restart some services or applications for the changes to take effect.