Check os version in Linux
The procedure to find os name and version on Linux:
Let us see all examples in detailed.
- Open the terminal application (bash shell)
- For remote server login using the ssh: ssh user@server-name
- Type any one of the following command to find os name and version in Linux:
cat /etc/os-release
lsb_release -a
hostnamectl - Type the following command to find Linux kernel version:
uname -r
/etc/os-release file
Type the following cat command:$ cat /etc/os-release
lsb_release command
The lsb_release command gives LSB (Linux Standard Base) and distribution-specific information on the CLI. The syntax is:$ lsb_release -a
hostnamectl command
Use hostnamectl command to query and change the system hostname and related settings. Just type the following command to check OS name and Linux kernel version:$ hostnamectl
uname command
Just print Linux kernel version, run:$ uname -r
Another option is to type the following command:$ cat /proc/version
/etc/issue file
Use more command/less command as follows:$ cat /etc/issue
$ more /etc/issue
$ less /etc/issue
Getting help
You can also view the manual page on uname using the following command:$ man hostnamectl
$ man uname
$ man cat