LinuxCommandLibrary

sysctl

View and modify kernel parameters

TLDR

Show all available variables and their values

$ sysctl -a
copy
Set a changeable kernel state variable
$ sysctl -w [section.tunable]=[value]
copy
Get currently open file handlers
$ sysctl fs.file-nr
copy
Get limit for simultaneous open files
$ sysctl fs.file-max
copy
Apply changes from /etc/sysctl.conf
$ sysctl -p
copy

SYNOPSIS

sysctl [options] [variable[=value]] ...

DESCRIPTION

sysctl is used to examine and modify kernel parameters at runtime. Parameters available are listed under /proc/sys/ and can be read or written using this tool.
Common categories include kernel. (core kernel settings), net. (networking), vm. (virtual memory), and fs. (filesystem). Changes made with sysctl are temporary unless persisted to configuration files.

PARAMETERS

-a, --all

Display all available variables
-w, --write
Write value to variable
-p, --load [_file_]
Load settings from file (default: /etc/sysctl.conf)
-n, --values
Print only values, not variable names
-e, --ignore
Ignore unknown variables
-q, --quiet
Suppress error messages
--system
Load settings from all system configuration files

CONFIGURATION

/etc/sysctl.conf

Main configuration file for persistent kernel parameter settings, loaded at boot.
**/etc/sysctl.d/*.conf**
Drop-in directory for modular kernel parameter configuration files.

CAVEATS

Changes are lost on reboot unless saved to /etc/sysctl.conf or files in /etc/sysctl.d/. Some parameters are read-only. Incorrect values can destabilize the system. Requires root privileges to modify values.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community