sysctl - configure kernel parameters at runtime
sysctl [options] [variable[=value]] [...]
Options you will use
variable- read one: vm.swappiness is /proc/sys/vm/swappiness
-w variable=value- set it (root) - lost at reboot
-p [FILE]- apply the settings in FILE (default /etc/sysctl.conf) now
--system- apply every /usr/lib, /run and /etc sysctl.d/*.conf file, like at boot
-n- print only the value
-a- every variable
Examples
$ sysctl vm.swappinessvm.swappiness = 60
$ sudo sysctl -w vm.swappiness=10until reboot; make it permanent in /etc/sysctl.d/99-local.conf
Gotchas
- sysctl is only a front end:
cat /proc/sys/vm/swappinessandecho 10 | sudo tee /proc/sys/vm/swappinessdo the same thing.
Taught in
Try sysctl in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.