How to Check Ubuntu Version / Debian Version

Question: How to check Ubuntu version / Debian version?
Sometimes you may need to check the version of Ubuntu/Debian installed on your machine. Here are some different ways by which you can find the version of Ubuntu/Debian the machine is running.
LSB Release:
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.
lsb_release -a
Output:
Ubuntu:
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.
Debian:
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.
Issue.net File:
Finally, you can also get the OS version details by taking a look at /etc/issue.net.
cat /etc/issue.net
Output:
Ubuntu:
Ubuntu 16.04.2 LTS
Debian:
Debian GNU/Linux 9
That’s All.