SYSCTL(8) System Manager's Manual SYSCTL(8)

# [NAME](#NAME)

sysctl - configure kernel parameters at runtime

# [SYNOPSIS](#SYNOPSIS)

**sysctl** \[*option* ...] *variable*\[**=value**] ...

**sysctl -p** *file-or-regexp* ...

# [DESCRIPTION](#DESCRIPTION)

**sysctl** is used to modify kernel parameters at runtime. The parameters available are those listed under */proc/sys/*. Procfs is required for **sysctl** support in Linux. You can use **sysctl** to both read and write sysctl data.

# [PARAMETERS](#PARAMETERS)

[*variable*](#variable)

The name of a key to read from. An example is kernel.ostype. The '/' separator is also accepted in place of a '.'.

[*variable*=*value*](#variable~2)

To set a key, use the form *variable*=*value* where *variable* is the key and *value* is the value to set it to. If the value contains quotes or characters which are parsed by the shell, you may need to enclose the value in double quotes.

[**-n**, **--values**](#n)

Use this option to disable printing of the key name when printing values.

[**-e**, **--ignore**](#e)

Use this option to ignore errors about unknown keys.

[**-N**, **--names**](#N)

Use this option to only print the names. It may be useful with shells that have programmable completion.

[**-q**, **--quiet**](#q)

Use this option to not display the values set to stdout.

[**-w**, **--write**](#w)

Force all arguments to be write arguments and print an error if they cannot be parsed this way.

[**-p**\[*FILE*\], **--load**\[=*FILE*\]](#p)

Load in **sysctl** settings from the file specified or */etc/sysctl.conf* if none given. Specifying - as filename means reading data from standard input. Using this option will mean arguments to **sysctl** are files, which are read in the order they are specified. The file argument may be specified as regular expression.

[**-a**, **--all**](#a)

Display all values currently available except deprecated and verboten parameters.

[**--deprecated**](#deprecated)

Include deprecated parameters to **--all** values listing.

[**-b**, **--binary**](#b)

Print value without new line.

[**--system**](#system)

Load settings from all system configuration files. See the **SYSTEM FILE PRECEDENCE** section below.

[**-r**, **--pattern** *pattern*](#r)

Only apply settings that match *pattern*. The *pattern* uses extended regular expression syntax.

[**-A**](#A)

Alias of **-a**

[**-d**](#d)

Alias of **-h**

[**-f**](#f)

Alias of **-p**

[**-X**](#X)

Alias of **-a**

[**-o**](#o)

Does nothing, exists for BSD compatibility.

[**-x**](#x)

Does nothing, exists for BSD compatibility.

[**-h**, **--help**](#h)

Display help text and exit.

[**-V**, **--version**](#V)

Display version information and exit.

# [FILES](#FILES)

*/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](#NOTES)

## [System file precedence](#System_file_precedence)

When using 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.

*/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.

## [Deprecated parameters](#Deprecated_parameters)

The **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 &gt; /proc/sys/net/ipv6/neigh/eth0/base\_reachable\_time

## [Verboten parameters](#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**](#stat_refresh)

This parameter returns no value but flushes per-cpu vm statistics.

# [EXAMPLES](#EXAMPLES)

/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

# [SEE ALSO](#SEE_ALSO)

[**proc**(5)](/man/os/procps/proc.5), [**sysctl.conf**(5)](/man/os/procps/sysctl.conf.5), [**regex**(7)](/man/os/procps/regex.7)

# [REPORTING BUGS](#REPORTING_BUGS)

Please send bug reports to [procps@freelists.org](mailto:procps@freelists.org).

2024-07-19 procps-ng

---

Document: sysctl(8) from procps 4.0.7-r2 (Chainguard OS)
Source: https://downloads.sourceforge.net/project/procps-ng/Production/procps-ng-4.0.7.tar.xz
