How to Check Ubuntu Version / Debian Version
lsb_release is a command can print certain LSB (Linux Standard Base) and Distribution information. You can use that command to get Ubuntu version or Debian version.
Distributor ID: Ubuntu Description: Ubuntu 16.04.2 LTS Release: 16.04 Codename: xenial
The above output confirms that the machine is running Ubuntu 16.04 LTS.
Distributor ID: Debian Description: Debian GNU/Linux 9.0 (stretch) Release: 9.0 Codename: stretch
From the above output, you can easily find it out that the OS version is Debian 9.
Finally, you can also get the OS version details by taking a look at /etc/issue.net.
Ubuntu 16.04.2 LTS
Debian GNU/Linux 9