sysctl in Linux: read and set kernel parameters
Updated July 3, 2026
sysctl reads and changes kernel parameters that live under /proc/sys.
Syntax
sysctl parameter[=value]Common cases
sysctl vm.swappiness # read a parameter
cat /proc/sys/vm/swappiness # the same thing as a file
sudo sysctl -w vm.swappiness=10 # change it until reboot
sysctl -a # every parameter at onceHow it works: a dot is a slash
A
sysctlparameter name is just a path under/proc/syswith the dots turned into slashes:vm.swappinessis the file/proc/sys/vm/swappiness. So you can read a parameter with eithercatorsysctl.sysctl -wchanges a value, but only until reboot. To make a setting survive a reboot, you write it into/etc/sysctl.confor a file in/etc/sysctl.d/. In the sandbox, writing kernel parameters is usually blocked, while reading them is fine.
Used in
You need this in the lesson The kernel via /proc. The theory is the chapter The Linux kernel at work.
See also
Try it
Open the sandbox: a real throwaway Linux terminal in your browser. Run the commands above by hand - the container is deleted when you leave.