↑ ↓ select, Enter open, Esc close

Show the Debian or Ubuntu version of a server

user@server
cat /etc/debian_version && grep -E '^(PRETTY_NAME|VERSION_CODENAME)=' /etc/os-release

First shows the point release from /etc/debian_version (for example 12.7), then the full name and codename from /etc/os-release. Useful before upgrades, when checking compatibility requirements or for support requests. Works even if lsb_release is not installed.

Note: On Ubuntu, /etc/debian_version only contains the underlying Debian base (such as trixie/sid). The relevant line there is PRETTY_NAME.

Also searched as

  • check debian version
  • find out os version linux
  • is this bookworm or bullseye
  • show ubuntu version

Related one-liners

All in Debian and APT

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.