Options: -a, --all display all variables -A alias of -a -X alias of -a --deprecated include deprecated parameters to listing -b, --binary print value without new line -e, --ignore ignore unknown variables errors -N, --names print variable names without values -n, --values print only values of a variables -p, --load[=<file>] read values from file -f alias of -p --system read values from all system directories -r, --pattern <expression> select setting that match expression -q, --quiet do not echo variable set -w, --write enable writing a value to variable -o does nothing -x does nothing -d alias of -h
-h, --help display this help and exit -V, --version output version information and exit
EXAMPLES: # Set vm.swappiness to 5 in /etc/sysctl.conf -sysctl: name:vm.swappiness value:5 state:present
# Remove kernel.panic entry from /etc/sysctl.conf -sysctl: name:kernel.panic state:absent sysctl_file:/etc/sysctl.conf
# Set kernel.panic to 3 in /tmp/test_sysctl.conf -sysctl: name:kernel.panic value:3 sysctl_file:/tmp/test_sysctl.conf reload:no
# Set ip forwarding on in /proc and do not reload the sysctl file -sysctl: name:net.ipv4.ip_forward value:1 sysctl_set:yes # Set ip forwarding on in /proc and in the sysctl file and reload if necessary -sysctl: name:net.ipv4.ip_forward value:1 sysctl_set:yes state:present reload:yes