How to check OS and version in a Linux command?

I just got my new VPS server. Actually, this is my first VPS server. I connect with the VPS with putty/ssh, how do I know which Linux OS is running on this vps? And what is the OS version?

Check os version in Linux

In this solution you will be able to find os name and version on Linux:

  1. Login using the ssh
  2. To find distribution information (OS name and version) use any of the following commands.
$ cat /etc/os-release
$ lsb_release -a
$ hostnamectl
  1. To find the Linux kernel version use the following command.
$ uname -r