Checking linux version from terminal

Linux Command: Show Linux Version

[a] uname – Print kernel and system information.

Tutorial details
Difficulty level Easy
Root privileges No
Requirements None
Est. reading time 1m

[b] lsb_release – Print distribution-specific information. [c] /proc/version file – Print running kernel information.

How to check linux kernel version number?

Open a shell prompt (or a terminal) and type the following command to see your current Linux kernel version:
$ uname -r
Sample outputs:

Or type the following command:
$ uname -mrs
Sample outputs:

To print all information, enter:
$ uname -a
Sample outputs:

  • 2.6.32-23 – Linux kernel version number
  • pae – pae kernel type indicate that I’m accssing more than 4GB ram using 32 bit kernel.
  • SMP – Kernel that supports multi core and multiple cpus.

/proc/version file

Type the following command to see Linux version info:
$ cat /proc/version
Sample outputs:

The above output identifies the kernel version that is currently running. It includes the contents of /proc/sys/kernel/ostype , /proc/sys/kernel/osrelease , and /proc/sys/kernel/version files. For example:
$ cat /proc/sys/kernel/
Sample outputs:

Find Distribution Version

Type the following command:
$ cat /etc/*release
OR
$ lsb_release -a
Sample outputs:

Here is another output from my Debian based server:

  • No ads and tracking
  • In-depth guides for developers and sysadmins at Opensourceflare✨
  • Join my Patreon to support independent content creators and start reading latest guides:
    • How to set up Redis sentinel cluster on Ubuntu or Debian Linux
    • How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
    • How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
    • A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
    • How to protect Linux against rogue USB devices using USBGuard

Join Patreon

This tutorial is also available in a quick video format:

🐧 Get the latest tutorials on Linux, Open Source & DevOps via

Источник

Ubuntu Documentation

Checking your Ubuntu Version

There are two ways to check which version of Ubuntu you are running. You can either check from within Unity, or put in a short command line in the Terminal.

In Unity

Unity is the default desktop environment since Ubuntu 11.04 (Natty Narwhal). Please note that this method will only show a partial version number. If you need a full version number like 14.04.1 LTS instead of 14.04 LTS you will need to use the terminal method.

Open System Settings

Click on Details

Your version will be shown under the Ubuntu logo.

In the Terminal

This method will work no matter which version of Ubuntu or desktop environment you are running.

Open the Terminal (keyboard shortcut: Ctrl+Alt+T)

Enter the command lsb_release -a

Your version will be shown on the Description line.

CheckingYourUbuntuVersion (последним исправлял пользователь blenderudit3d 2014-11-18 13:52:51)

The material on this wiki is available under a free license, see Copyright / License for details
You can contribute to this wiki, see Wiki Guide for details

Источник

How to check os version in Linux command line

Check os version in Linux

The procedure to find os name and version on Linux:

  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

Let us see all examples in details for common Linux distros.

The /etc/os-release file

Type the following cat command:
$ cat /etc/os-release
Sample outputs:

We can filter out information such as OS version and name using the grep command/egrep command as follows:
$ grep ‘^VERSION’ /etc/os-release
$ egrep ‘^(VERSION|NAME)=’ /etc/os-release
Here is what we see:

Even tiny Linux distro such as Alpine Linux provide the required OS (Operating system) information, including version:

Checking OS version on Linux using the 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
Sample outputs:

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
And it will give info as follows. Look out for “ Operating System ” and “ Kernel “:

Another outputs from my OpenSUSE Linux 15.2 server:

uname command

/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

  • No ads and tracking
  • In-depth guides for developers and sysadmins at Opensourceflare✨
  • Join my Patreon to support independent content creators and start reading latest guides:
    • How to set up Redis sentinel cluster on Ubuntu or Debian Linux
    • How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
    • How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
    • A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
    • How to protect Linux against rogue USB devices using USBGuard

Join Patreon

Conclusion

We explained how to find and display the OS version on Linux. The safest option is to query /etc/os-release file using grep or cat command. Systemd based Linux distro users can use the hostnamectl command.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via

Источник

How to check Ubuntu version in Linux command line

Check Ubuntu version in Linux

The procedure to find os name and version on Ubuntu Linux:

  1. Open the terminal application (bash shell) by pressing Ctrl+Alt+T
  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 Ubuntu:
    cat /etc/os-release
    lsb_release -a
    hostnamectl
  4. Type the following command to find Ubuntu Linux kernel version:
    uname -r

Let us see all examples in detailed to check your version.

Ubuntu Show Version Number using /etc/os-release file

Type the following cat command:
$ cat /etc/os-release
Sample outputs:

Here is another outputs:

Checking your Ubuntu version From the lsb_release terminal command

The lsb_release command gives LSB (Linux Standard Base) and distribution-specific information on the CLI. The syntax is:
$ lsb_release -a
Sample outputs:

How to check Ubuntu version using the hostnamectl command

The hostnamectl command may be used to query and change the system hostname and related settings. It can also display your Linux distribution name and kernel version as well:
$ hostnamectl

Not a fan of the Ubuntu command line? Try GUI

You can see Ubuntu version graphically, i.e. using GUI. Open System Settings by pressing the Super key on your keyboard and type “settings“. Click on Details. You will see version below Ubuntu Logo:

How do I check the version of Ubuntu I am running using GUI?

Conclusion

It is a good idea to check your Ubuntu version so that you can apply patches and update versions for security and performance reasons. Ubuntu release cycle is divided into two groups:

  • No ads and tracking
  • In-depth guides for developers and sysadmins at Opensourceflare✨
  • Join my Patreon to support independent content creators and start reading latest guides:
    • How to set up Redis sentinel cluster on Ubuntu or Debian Linux
    • How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
    • How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
    • A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
    • How to protect Linux against rogue USB devices using USBGuard

Join Patreon

  • LTS (Long Term Support) release, which is published every two years in April. For servers and stability reasons, you always need to use LTS.
  • Interim release – Every six months Canonical releases a short version of Ubuntu, which is suitable for cutting edge hardware and desktop users.

You learned how to check your current Ubuntu version through the command-line and GUI. For more info see this page here.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via

Источник

3 Ways to Check Linux Kernel Version in Command Line

Last updated October 29, 2020 By Abhishek Prakash 25 Comments

Brief: Wondering which Linux kernel version your system uses? Here are several ways to check your kernel version in the Linux terminal.

You may find yourself in a situation where you need to know the exact Linux kernel version being used on your system. Thanks to the powerful Linux command line, you can easily find that out.

Quick way to check Linux kernel version

You can use the following command to get the Linux kernel version:

uname -r

There are other ways to get even more detailed information about kernel. Read the rest of the article to learn it in detail.

In this article, I’ll show you various methods for finding out your kernel version and tell you what those numbers actually mean. If you prefer videos, here’s a quick one. Don’t forget to subscribe to our YouTube channel for more Linux tips.

How to find Linux kernel version

I am using Ubuntu while writing this article. But these commands are generic and can be used on Fedora, Debian, CentOS, SUSE Linux or any other Linux distribution.

1. Find Linux kernel using uname command

uname is the Linux command for getting system information. You can also use it to find out whether you’re using a 32-bit or 64-bit system.

Open a terminal and type in the following command:

The output will be something similar to this:

This means that you’re running Linux kernel 4.4.0-97, or in more generic terms, you are running Linux kernel version 4.4.

But what do the other digits mean here? Let me explain:

  • 4 – Kernel version
  • 4 – Major revision
  • 0 – Minor revision
  • 97 – Bug fix
  • generic – Distribution-specific string. For Ubuntu, it means I’m using the desktop version. For Ubuntu server edition, it would be ‘server’.

You can also use the uname command with the option -a. This will provide more system information if you need it.

The output of the command should like this:

Let me explain the output and what it means:

  • Linux – Kernel name. If you run the same command on BSD or macOS, the result will be different.
  • itsfoss – Hostname.
  • 4.4.0-97-generic – Kernel release (as we saw above).
  • #120-Ubuntu SMP Tue Sep 19 17:28:18 UTC 2017 – This means that Ubuntu has compiled 4.4.0-97-generic 120 times. A timestamp for the last compilation is also there.
  • x86_64 – Machine architecture.
  • x86_64 – Processor architecture.
  • x86_64 – Operating system architecture (you can run a 32-bit OS on a 64-bit processor).
  • GNU/Linux – Operating system (and no, it won’t show the distribution name).

But I’ll save you from information overload. Let’s see some other commands to find your Linux kernel version.

2. Find Linux kernel using /proc/version file

In Linux, you can also find the kernel information in the file /proc/version. Just look at the contents of this file:

You’ll see an output similar to what you saw with uname.

You can see the kernel version 4.4.0-97-generic here.

3. Find Linux kernel version using dmesg commad

dmesg is a powerful command used for writing kernel messages. It’s also very useful for getting system information.

Since dmesg provides an awful lot of information, you should normally use a command like less to read it. But since we’re here just to check the Linux kernel version, grepping on ‘Linux’ should give the desired output.

The output will have a few lines but you should be able to identify the Linux kernel version there easily.

How do you check your Linux kernel version and other information?

Of the three ways discussed here, I use uname all the time. It’s the most convenient.

What about you? Which command do you prefer for getting Linux kernel information?

Like what you read? Please share it with others.

Источник

Читайте также:  Как уничтожить mac os
Оцените статью