commands

sysctl — Read selected runtime kernel parameters

Read an individual non-sensitive kernel parameter; availability and scope depend on the kernel and namespaces. This reference does not authorize writes. Use a fresh private workspace; No production workload is required.

Formal Syntax & Structure

linux syntaxlinux
sysctl -n KEY

Parameters & Attributes

NameTypeDescription
-noptionPrint value without parameter name.
KEYoperandRead-only dotted parameter name, for example kernel.osrelease; do not append =VALUE.

Return Value

exit status and output

The -n query prints only the value of the named kernel parameter. A missing or unreadable key produces a failure; successful reading does not imply permission to change it.

Working Example

Example Snippetlinux
test -n "$(sysctl -n kernel.osrelease)" && printf 'release reported\n'
Linux Reference