Check the release string of the running kernel.
Show a value such as 6.8.0-xx, not the host name or machine type.
Which command is appropriate?
uname reports system information by field. The -r option prints the kernel release, while -s prints its name.
Detailed explanation
uname -nIncorrect. -n prints the network node or host name.
Incorrect. -n prints the network node or host name.
uname -mIncorrect. -m prints the machine hardware name.
Incorrect. -m prints the machine hardware name.
uname -sIncorrect. -s prints the kernel name, such as Linux.
Incorrect. -s prints the kernel name, such as Linux.
uname -rCorrect. -r prints the running kernel release string.
Correct. -r prints the running kernel release string.
Try it yourself
An example you can run in a temporary verification environment.
uname -rExpected result
実行中カーネルのリリース文字列Key points
- uname -r
- uname -s
- uname -m
Notes
- Environment: GNU coreutils 9.x
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.