What version of Linux do I have? Find out at command line

I am a new Linux system user and developer. What version of Linux do I have? What’s my OS and How do I find out from the command line? How do I check Linux version from the GUI or the CLI?

Introduction: Linux is a free and open source operating system (OS). An OS used to control your desktop/laptop hardware, runs apps, manages users and permissions, and more. It also controls various resources and runs multiple server apps such as Nginx, MySQL, PHP and more.

Command to find of what version of Linux am I running?

  1. lsb_release -a – Best command to print Linux version
  2. hostnamectl – See Linux name and version
  3. cat /etc/*release – Show Linux version and distro info
  4. uname -a : Display system information

What version of Linux do I have? Find out at command line

Open the terminal application and type the following command to see Linux version:
What version of Linux do I have
Look for “Operating System” in above screen shot. One can use the grep command or egrep command as follows:
hostnamectl | grep "Operating System"
hostnamectl | egrep "(System|Kernel)"

Sample outputs:

  Operating System: CentOS Linux 7 (Core)
            Kernel: Linux 3.10.0-862.14.4.el7.x86_64

Here is another output from my RHEL server/vm running at cloud data center:
$ hostnamectl
Sample outputs:

   Static hostname: rhel7-nixcraft
         Icon name: computer-vm
           Chassis: vm
        Machine ID: bfce903b80a54432b8b992b24603144d
           Boot ID: 97227bae46f8413a946110683f9d5ed1
    Virtualization: kvm
  Operating System: Red Hat Enterprise Linux
       CPE OS Name: cpe:/o:redhat:enterprise_linux:7.5:GA:server
            Kernel: Linux 3.10.0-862.14.4.el7.x86_64
      Architecture: x86-64

Command to find version of Linux

Another option that works is to issue the lsb_release command:
lsb_release -a

The command indicates that I am using “SUSE Linux Enterprise Server 12 SP3” release 12.3. Here is another output from my Debian server:

No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 9.6 (stretch)
Release:	9.6
Codename:	stretch

What’s the version of my OS?

If above command not working try the following cat command:
$ cat /etc/*release
Here is output from my Fedora Linux box:

Fedora release 28 (Twenty Eight)
VERSION="28 (Twenty Eight)"
PRETTY_NAME="Fedora 28 (Twenty Eight)"
Fedora release 28 (Twenty Eight)
Fedora release 28 (Twenty Eight)

Find Linux Kernel version command

Simply type the following cat command or uname command:
$ uname
$ uname -mrs
$ uname -a
$ cat /proc/version

A note about GUI method

Go to your Linux system settings and and click on details. You will see info as follows:

Checking your Ubuntu Version using GUI


You just learn various command to get information about your Linux disro.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 5 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
5 comments… add one
  • Xyz Feb 11, 2010 @ 23:23

    Following always worked for me
    cat /etc/*issue

  • Dexter May 13, 2010 @ 18:42

    For FreeBSD unix uname just works:

  • Joy Nov 2, 2011 @ 3:34

    I am Solaris Unix user and uname works on both Linux and Solaris but not showrev:

    uname -a 
    showrev -a
  • Marlena May 16, 2012 @ 18:29

    Since others have added their oses, I am going to add IBM AIX info ;)
    oslevel -r
    uname -a
    lslpp -h bos.rte

    • CiscoIOS Aug 11, 2013 @ 13:44

      Cisco IOS used by core/edge routers and switches:
      show version

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum