Back to commands

Linux Survival Basics

Read-only

Compare Kernel and Distro Versions

You need to know whether a package issue is tied to the OS release, the running kernel, or the CPU architecture.

Command

printf 'kernel=%s arch=%s distro=%s\n' "$(uname -r)" "$(uname -m)" "$(lsb_release -ds)"

Before you run this

System impact: Read-only. Low when scoped to the shown target.

When not to use it: Do not treat the kernel version as the installed kernel package list.

Expected output

A single support-friendly inventory line with kernel, architecture, and distro.

System impact

Read-only. Nothing changes. The command combines kernel, architecture, and distro description in one line.

Recovery / rollback: no state is changed.

When to use it

Use when opening support tickets, comparing fleet nodes, or checking whether the running kernel matches package expectations.

When not to use it

Do not treat the kernel version as the installed kernel package list.

Explanation-only example

Illustrated output, not a live lab run

This example is intentionally illustrative. It shows the command shape without killing real processes or changing your machine.

demo@lab:~$

$ uname -a

Linux pkg-demo 6.8.0-60-generic #63-Ubuntu SMP PREEMPT_DYNAMIC x86_64 GNU/Linux

$ printf 'kernel=%s arch=%s distro=%s\n' "$(uname -r)" "$(uname -m)" "$(lsb_release -ds)"

kernel=6.8.0-60-generic arch=x86_64 distro=Ubuntu 24.04.2 LTS
View commands shown

These are the commands shown in the sanitized transcript.

Commands shown

  1. uname -a
  2. printf 'kernel=%s arch=%s distro=%s\n' "$(uname -r)" "$(uname -m)" "$(lsb_release -ds)"

next steps

Related commands

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

Count Source Files by Extension

A quick extension count can show whether expected content made it into the source tree.

find source -type f -printf '%f\n' | sed -n 's/.*\.//p' | sort | uniq -c | sort -nr
Linux Survival Basics Read-only

List Installed Package Versions

A package inventory beats memory when a server is drifting.

dpkg-query -W -f='${Package}\t${Version}\t${Architecture}\n' | sort
Linux Survival Basics Can be slow

Find the Files Eating Your Disk

The disk was full, but guessing at folders was the slow part.

find /var -type f -printf '%s %p\n' | sort -nr | head -20
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.

  • lpic1:103-gnu-unix-commands
  • lfcs:essential-commands
  • risk:read-only

Useful for

  • LPIC-1 style command-line practice
  • LFCS style performance tasks
  • Linux+ style troubleshooting review

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