Back to the command reference

sysctl

SystemAdvanced In simulator In real Linux

View or change kernel parameters

Name: sysctl = system control

You can practise it right away in the simulator, and use it in real Linux mode too.

Description

sysctl reads and changes kernel parameters at runtime, the same ones exposed under /proc/sys/. Values set with -w are lost on reboot; put them in /etc/sysctl.conf or /etc/sysctl.d/ to keep them.

Syntax

sysctl [OPTION]... [NAME[=VALUE]]

Common options

-a / --allList all parameters
-n / --valuesPrint only values, not names
-w / --writeSet a parameter (until reboot)
-p / --loadLoad from /etc/sysctl.conf
--systemLoad the settings from every configuration directory (/etc/sysctl.d/ …)

Examples

  • $ sysctl net.ipv4.ip_forward

    Is IP forwarding on?

    Explain
  • $ sudo sysctl -w vm.swappiness=10

    Use swap less aggressively

    Explain

Related