Linux Survival Basics
Read-onlyShow Running Kernel Version
You need the currently running kernel release.
Command
uname -r
Before you run this
System impact: Read-only. Low when scoped to the shown target.
When not to use it: Do not remove the matching installed kernel package.
Expected output
The running kernel release string.
System impact
Read-only. Nothing changes. The command reads current state and prints diagnostic evidence.
Recovery / rollback: no state is changed.
When to use it
Use before kernel package cleanup.
When not to use it
Do not remove the matching installed kernel package.
Example run
Commands shown
These are the commands shown for inspection. Treat them as an example, not proof that your system will behave identically.
uname -runame -r
next steps
Related commands
Compare Kernel and Distro Versions
The distro version and kernel version answer different questions.
printf 'kernel=%s arch=%s distro=%s\n' "$(uname -r)" "$(uname -m)" "$(lsb_release -ds)"
Fingerprint a Debian or Ubuntu Host
Before package triage, prove what OS family and release you are actually on.
. /etc/os-release && printf '%s %s %s\n' "$ID" "$VERSION_ID" "$VERSION_CODENAME"
Find Running Package Manager Processes
A package lock is usually a symptom, not the first thing to delete.
ps -ef | grep -E 'apt|dpkg|dnf|yum|pacman' | grep -v grep
Show Recent Server Reboots
Confirm whether the server actually rebooted and when.
last -x reboot | head -5
Check the Installed and Candidate Package Version
apt policy explains where the next version would come from.
apt policy nginx
next diagnostic step
Where to go from this command
- Boot partition full hub Use before deciding old-kernel cleanup.
Study mapping
Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.
Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.