SYSCTL(8)
๐ SYSCTL(8) โ the system manager's manual, but make it cute ๐
okay bestie, sit down, hydrate, and let me tell you about sysctl from the System Manager's Manual (that's section 8, the big-kid admin section ๐). this is the tool that pokes at your kernel's live settings, and honestly? it's giving main character energy.
โจ NAME โจ
sysctl โ configure kernel parameters at runtime ๐๏ธ
๐ธ SYNOPSIS ๐ธ
sysctl [option ...] variable[=value] ...
sysctl -p file-or-regexp ...
that's it, that's the whole vibe. read stuff, write stuff, or load a whole file of stuff. ๐ซถ
๐ฆ DESCRIPTION ๐ฆ
so sysctl is what you use to modify kernel parameters at runtime. the parameters you can touch are the ones listed under /proc/sys/. Procfs is required for sysctl support in Linux, so no procfs = no dice, sorry. ๐
and like, you can do both: use sysctl to read sysctl data and to write it. a little multitasking icon, we love to see it. โจ
๐ PARAMETERS ๐
okay this section is doing a lot of work because it's got the arguments AND the options, so buckle up.
variableโ the name of a key to read from. an example iskernel.ostype. and ngl, the/separator is also accepted in place of a., so you've got options. ๐variable=valueโ to set a key, use the formvariable=valuewherevariableis the key andvalueis the value you're setting it to. heads up though: if the value contains quotes or characters which are parsed by the shell, you may need to enclose the value in double quotes. the shell is nosy like that. ๐-n,--valuesโ use this option to disable printing of the key name when printing values. just the value, no name, no small talk.-e,--ignoreโ use this option to ignore errors about unknown keys. she's unbothered. โจ-N,--namesโ use this option to only print the names. it may be useful with shells that have programmable completion. iykyk. ๐-q,--quietโ use this option to not display the values set to stdout. silent but deadly (in a cute way).-w,--writeโ force all arguments to be write arguments and print an error if they cannot be parsed this way. no reading today, we're writing only. โ๏ธ-p[FILE],--load[=FILE]โ load in sysctl settings from the file specified, or/etc/sysctl.confif none given. specifying-as filename means reading data from standard input. using this option will mean arguments tosysctlare files, which are read in the order they are specified. and plot twist: the file argument may be specified as regular expression. ๐-a,--allโ display all values currently available except deprecated and verboten parameters. (yes, "verboten." they really said that. iconic.)--deprecatedโ include deprecated parameters to--allvalues listing. peek at the ghosts if you must. ๐ป-b,--binaryโ print value without new line.--systemโ load settings from all system configuration files. see the SYSTEM FILE PRECEDENCE section below. ๐-r,--patternpattern โ only apply settings that match pattern. the pattern uses extended regular expression syntax. regex girlies rise. ๐-Aโ alias of-a-dโ alias of-h-fโ alias of-p-Xโ alias of-a-oโ does nothing, exists for BSD compatibility. she's just here for the vibes. ๐ซฅ-xโ does nothing, exists for BSD compatibility. also just vibing. ๐ซฅ-h,--helpโ display help text and exit.-V,--versionโ display version information and exit.
๐ง FILES ๐ง
these are the spots on the map bestie:
/proc/sys/etc/sysctl.d/*.conf/run/sysctl.d/*.conf/usr/local/lib/sysctl.d/*.conf/usr/lib/sysctl.d/*.conf/lib/sysctl.d/*.conf/etc/sysctl.conf
โญ NOTES โญ
๐ธ System file precedence
when you use the --system option, sysctl will read files from directories in the following list in given order from top to bottom. once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored. first come, first served, no cap. ๐
/etc/sysctl.d/*.conf/run/sysctl.d/*.conf/usr/local/lib/sysctl.d/*.conf/usr/lib/sysctl.d/*.conf/lib/sysctl.d/*.conf
all configuration files are sorted in lexicographic order, regardless of the directory they reside in. configuration files can either be completely replaced (by having a new configuration file with the same name in a directory of higher priority) or partially replaced (by having a configuration file that is ordered later).
the file /etc/sysctl.conf is read last, which means it can replace/override any parameters previously set in files in the listed directories. she gets the final word. ๐
๐ Deprecated parameters
base_reachable_time and retrans_time are deprecated. the sysctl command does not allow changing values of these parameters. users who insist to use deprecated kernel interfaces should push values to /proc file system by other means. for example:
echo 256 > /proc/sys/net/ipv6/neigh/eth0/base_reachable_time
ok so lowkey if you're insisting on this, you're on your own, bestie. do not come for me. ๐ญ
๐ Verboten parameters
certain kernel parameters should not be read due to side-effects and will be skipped by sysctl using the --all option.
stat_refreshโ this parameter returns no value but flushes per-cpu vm statistics.
๐ฅ EXAMPLES ๐ฅ
here's the group chat showing receipts:
/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 --pattern '^net.ipv6' --system
look at her go. ate and left no crumbs. ๐
๐ SEE ALSO ๐
proc(5), sysctl.conf(5), regex(7)
๐ REPORTING BUGS ๐
please send bug reports to procps@freelists.org.
and that's the whole page, bestie!! this beauty is from procps-ng, dated 2024-07-19, and it lives in section 8 of the manual. go forth and configure your kernel, you absolute legend ๐ซถโจ๐๐
๐ฆ where this page comes from
- alpine 3.23: procps-ng-doc 4.0.5-r0 ยท GPL-2.0-or-later AND LGPL-2.1-or-later
- alpine 3.24: procps-ng-doc 4.0.6-r0 ยท GPL-2.0-or-later AND LGPL-2.1-or-later
- arch rolling: procps-ng 4.0.7-1 ยท GPL AND LGPL
- fedora 44: procps-ng 4.0.6-1.fc44 ยท GPL-2.0-or-later AND LGPL-2.0-or-later AND LGPL-2.1-or-later
- fedora 44: procps-ng 4.0.6-1.fc44 ยท GPL-2.0-or-later AND LGPL-2.0-or-later AND LGPL-2.1-or-later
- nixos 26.05: procps 4.0.6
- nixpkgs unstable: procps 4.0.7
- ubuntu stonking: procps 2:4.0.6-3ubuntu1 ยท LGPL-2.1-or-later
- Copyright (c) 2011-2024 Craig Small <csmall@dropbear.xyz>
- Copyright (c) 2013-2023 Jim Warner <james.warner@comcast.net>
- Copyright (c) 2011-2012 Sami Kerola <kerolasa@iki.fi>
- Copyright (c) 2004-2006 Albert Cahalan
- Copyright (c) 1999 George Staikos <staikos@0wned.org>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms