How to check os version in Linux command line

Hostnbit

Check os version in Linux

The procedure to find os name and version on Linux:

Let us see all examples in detailed.

  1. Open the terminal application (bash shell)
  2. For remote server login using the ssh: ssh user@server-name
  3. Type any one of the following command to find os name and version in Linux:
    cat /etc/os-release
    lsb_release -a
    hostnamectl
  4. 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

Hostnbit

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Menu Title
Scroll to Top