Back to commands

Linux Survival Basics

Read-only

Show 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.

  1. uname -r
  2. uname -r

next steps

Related commands

Linux Survival Basics Read-only

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)"
Linux Survival Basics Read-only

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"
Linux Survival Basics Can be slow

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
Linux Survival Basics Sensitive output

Show Recent Server Reboots

Confirm whether the server actually rebooted and when.

last -x reboot | head -5

next diagnostic step

Where to go from this command

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.

  • LPIC-1 style command-line practice
  • LFCS style performance-task practice

Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.