Linux Survival Basics
Read-onlyCompare 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.
$ 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
uname -aprintf 'kernel=%s arch=%s distro=%s\n' "$(uname -r)" "$(uname -m)" "$(lsb_release -ds)"
next steps
Related commands
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"
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
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
Check One Installed Package Cleanly
For one package, dpkg-query gives a clean status line.
dpkg-query -W -f='${Status} ${Version}\n' openssl
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.
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.