Linux "sysctl" Command Line Options and Examples
configure kernel parameters at runtime

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.


Usage:

sysctl [options] [variable[=value]] [...]
    sysctl -p [file or regexp] [...]




Command Line Options:

-n
Use this option to disable printing of the key name when printing values.
sysctl -n ...
-e
Use this option to ignore errors about unknown keys.
sysctl -e ...
-N
Use this option to only print the names. It may be useful with shells that have programmable comple‐tion.
sysctl -N ...
-q
Use this option to not display the values set to stdout.
sysctl -q ...
-w
Use this option when you want to change a sysctl setting.
sysctl -w ...
-p[FILE]
Load in sysctl settings from the file specified or /etc/sysctl.conf if none given. Specifying - asfilename means reading data from standard input. Using this option will mean arguments to sysctl arefiles, which are read in the order they are specified. The file argument may be specified as regularexpression.
sysctl -p[FILE] ...
-a
Display all values currently available.
sysctl -a ...
--deprecated
Include deprecated parameters to --all values listing.
sysctl --deprecated ...
-b
Print value without new line.
sysctl -b ...
--system
Load settings from all system configuration files./run/sysctl.d/*.conf/etc/sysctl.d/*.conf/usr/local/lib/sysctl.d/*.conf/usr/lib/sysctl.d/*.conf/lib/sysctl.d/*.conf/etc/sysctl.conf
sysctl --system ...
-r
Only apply settings that match pattern. The pattern uses extended regular expression syntax.
sysctl -r ...
-o
exists for BSD compatibility.
sysctl -o ...
-x
exists for BSD compatibility.
sysctl -x ...
-h
Display help text and exit.
sysctl -h ...
-V
Display version information and exit.EXAMPLES/sbin/sysctl -a/sbin/sysctl -n kernel.hostname/sbin/sysctl -w kernel.domainname="example.com"/sbin/sysctl -p/etc/sysctl.conf/sbin/sysctl -a --pattern forward/sbin/sysctl -a --pattern forward$/sbin/sysctl -a --pattern 'net.ipv4.conf.(eth|wlan)0.arp'/sbin/sysctl --system --pattern '^net.ipv6'DEPRECATED PARAMETERSThe base_reachable_time and retrans_time are deprecated. The sysctl command does not allow changing values ofthese parameters. Users who insist to use deprecated kernel interfaces should push values to /proc file sys‐tem by other means. For example:echo 256 > /proc/sys/net/ipv6/neigh/eth0/base_reachable_timeFILES/proc/sys/etc/sysctl.conf
sysctl -V ...