sysctl(8)
-sysctl - configure kernel parameters at runtime
Description
sysctl is used to modify kernel parameters at runtime. The parameters available are those listed under /proc/sys/. Procfs is required for sysctl(8) support in Linux. You can use sysctl(8) to both read and write sysctl data
Parameters
variable
The name of a key to read from. An example is kernel.ostype. The '/' separator is also accepted in place of a '.'.
variable
The name of a key to read from. An example is kernel.ostype. The '/' separator is also accepted in place of a '.'.
n
Use this option to disable printing of the key name when printing values.
-e
Use this option to ignore errors about unknown keys.
-N
Use this option to only print the names. It may be useful with shells that have programmable completion.
-q
Use this option to not display the values set to stdout.
-w
Use this option when you want to change a sysctl setting. -w 临时改动某个指定参数的值,如
sysctl -w net.ipv4.ip_forward=1
-p
Load in sysctl settings from the file specified or /etc/sysctl.conf if none given. Specifying - as filename means reading data from standard input. 从指定的文件加载系统参数,如不指定即从/etc/sysctl.conf中加载
-a
Display all values currently available.
-A
Same as -a
Use this option to disable printing of the key name when printing values.
-e
Use this option to ignore errors about unknown keys.
-N
Use this option to only print the names. It may be useful with shells that have programmable completion.
-q
Use this option to not display the values set to stdout.
-w
Use this option when you want to change a sysctl setting. -w 临时改动某个指定参数的值,如
sysctl -w net.ipv4.ip_forward=1
-p
Load in sysctl settings from the file specified or /etc/sysctl.conf if none given. Specifying - as filename means reading data from standard input. 从指定的文件加载系统参数,如不指定即从/etc/sysctl.conf中加载
-a
Display all values currently available.
-A
Same as -a
Notes
Please note that modules loaded after sysctl is run may override the settings (example: sunrpc.* settings are overridden when the sunrpc module is loaded). This may cause some confusion during boot when the settings in sysctl.conf may be overriden. To prevent such a situation, sysctl must be run after the particular module is loaded (e.g., from /etc/rc.d/rc.local or by using the install directive in modprobe.conf)
Please note that modules loaded after sysctl is run may override the settings (example: sunrpc.* settings are overridden when the sunrpc module is loaded). This may cause some confusion during boot when the settings in sysctl.conf may be overriden. To prevent such a situation, sysctl must be run after the particular module is loaded (e.g., from /etc/rc.d/rc.local or by using the install directive in modprobe.conf)
Files
/proc/sys /etc/sysctl.conf
See Also
sysctl.conf(5), modprobe.conf(5)
Author
/proc/sys /etc/sysctl.conf
See Also
sysctl.conf(5), modprobe.conf(5)
Author