Back to commands

Linux Survival Basics

Read-only

Fingerprint a Debian or Ubuntu Host

A server is described as Debian or Ubuntu, but you need the exact release fields before interpreting package output.

Command

. /etc/os-release && printf '%s %s %s\n' "$ID" "$VERSION_ID" "$VERSION_CODENAME"

Before you run this

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

When not to use it: Do not use it as proof of the running kernel or CPU architecture.

Expected output

A compact line such as ubuntu 24.04 noble.

System impact

Read-only. Nothing changes. The command reads /etc/os-release and prints the package-relevant identity fields.

May require elevated permissions on protected paths or service-owned files.

Recovery / rollback: no state is changed.

When to use it

Use before debugging apt sources, package versions, upgrade paths, or OS support questions.

When not to use it

Do not use it as proof of the running kernel or CPU architecture.

next steps

Related commands

Linux Survival Basics Can be slow

List Enabled Apache Sites

Apache may not be using the vhost file you edited.

find /etc/apache2/sites-enabled -maxdepth 1 -type l -printf '%f -> %l ' 2>/dev/null | sort
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 Can be slow

Find Nginx SSL Certificate Directives

The wrong certificate is often in the server block.

grep -RInE 'ssl_certificate|ssl_certificate_key|server_name' /etc/nginx/sites-enabled /etc/nginx/conf.d 2>/dev/null
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.