You need to add a repository — but have no idea which version is installed. Or you are configuring someone else's server and want to understand what you are dealing with before touching anything. Debian has several ways to find out, and each gives slightly different information.
Method 1: lsb_release — Fast and Readable
The most convenient approach — the lsb_release utility. The -a flag outputs everything at once: distributor, description, release number, and codename:
lsb_release -a

For a single-line summary only:
lsb_release -d

The codename (buster, bullseye, bookworm) matters more than the version number — it is what goes into apt repository lines.
Method 2: /etc/os-release — Machine-Readable Format
The /etc/os-release file is a standard across all modern Linux distributions. It contains variables that are easy to parse in scripts:
cat /etc/os-release

Extract a specific variable in a script:
. /etc/os-release && echo $VERSION_CODENAME
Method 3: hostnamectl — Version Plus Hardware
hostnamectl shows not just the OS version but also kernel version, architecture, virtualization type, and Machine ID. Useful for initial inspection of an unfamiliar server:
hostnamectl

The Virtualization: oracle line immediately reveals the system is running in VirtualBox. On bare metal and KVM VPS instances this field will differ.
Method 4: /etc/issue — One Line
/etc/issue is a text file displayed before the login prompt. Contains minimal information:
cat /etc/issue

\n and \l are substitutions for hostname and terminal number shown at login. The codename is not stored here — only the version number.
Method 5: /etc/debian_version — Point Release
The most minimal file. Shows the version including the point release:
cat /etc/debian_version
10.13
10.13 means Debian 10, thirteenth point release. The file updates with every point update — useful for checking how current the system is within its branch.
Method 6: hardinfo — Graphical Interface
For those who prefer a GUI — the hardinfo utility displays full system information in a window.
Install:
sudo apt install hardinfo

Launch from the menu or by running hardinfo in the terminal.
Method 7: uname -a — Kernel Version
The uname command is standard across all Unix systems. It shows the kernel version, not the distribution version:
uname -a

Distribution version and kernel version are different things. Debian 10 can run kernel 4.19 or 5.10 depending on updates. uname -a shows the kernel specifically.
Method 8: /etc/apt/sources.list — Which Branch
This file answers: are you running Stable, Testing, or Unstable:
cat /etc/apt/sources.list

Look at the word after the repository URL:
buster,bullseye,bookworm— a specific stable releasestable— always the current stable release (automatic branch switch on major upgrade)testing— the next release in developmentunstableorsid— the development branch
Quick Reference
| Task | Command |
|---|---|
| Version + codename (full) | lsb_release -a |
| Version + codename (short) | lsb_release -d |
| Machine-readable variables | cat /etc/os-release |
| Version + kernel + architecture | hostnamectl |
| Minimal — version only | cat /etc/issue |
| Point release number | cat /etc/debian_version |
| Kernel version | uname -a |
| Repository branch | cat /etc/apt/sources.list |
| GUI with full info | sudo apt install hardinfo && hardinfo |