On the terminal, there are a plethora of commands that spit out answers to questions about the Linux kernel and/or the Linux distribution underpinning your system.
Let’s take a deko at a few of them.
Some of the below commands give only the distro, others mention just the kernel version and a few provide information on the kernel, distro and whether it’s a 32-bit or 64-bit Linux OS.
My favorite command line tool inxi provides details on kernel, distribution and whether you’re running a 32-bit or 64-bit OS.
$ inxi -S System: Host: Tanya Kernel: 3.13.0-24-generic i686 (32 bit) Desktop: Gnome Distro: Linux Mint 17.1 Rebecca
Some distributions like Linux Mint come with inxi pre-installed.
If inxi is not on your system, I strongly recommend you get it asap.
You can easily install inxi by running the below command:
sudo apt-add-repository ppa:unit193/inxi && apt-get update
Once you’ve completed the above step, then run the below command to complete installation of inxi.
apt-get install inxi
$ sudo yum install inxi
For a quick glance at just the kernel version on your computer, try either of the below commands.
$ uname -r 3.13.0-24-generic
$ uname -mrs Linux 3.13.0-24-generic i686
The i686 notation (above) means that it’s a 32-bit OS.
$ uname -a Linux Sasha 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:31:42 UTC 2014 i686 i686 i686 GNU/Linux
Uname is easy to remember for kernel information but not so great for distribution details because even if you’re running Linux Mint it’ll tell you Ubuntu (the foundation of Linux Mint).
For a quick glance at the Linux distribution on your computer, go for the below command.
$ cat /etc/issue Linux Mint 17.1 Rebecca \n \l
For a more detailed explanation, try the below command:
$ cat /etc/*release DISTRIB_ID=LinuxMint DISTRIB_RELEASE=17.1 DISTRIB_CODENAME=rebecca DISTRIB_DESCRIPTION="Linux Mint 17.1 Rebecca" NAME="Ubuntu" VERSION="14.04.1 LTS, Trusty Tahr" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 14.04.1 LTS"
If all you’re interested in is whether it’s 32-bit OS or 64-bit OS, go for the below command.
$ getconf LONG_BIT 32
Here’s annother way to find out if your computer is running a 32-bit or 64-bit Linux.
$ file /sbin/init /sbin/init: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=c394677bccc720a3bb4f4c42a48e008ff33e39b1, stripped
Need one more way to find out if your Linux OS is 32-bit or 64-bit?
OK, here we go.
$ arch i686
Simple as pie, right?
Now before I run out steam, let me show you one more way to check your Linux distribution and its version.
$ lsb_release -a No LSB modules are available. Distributor ID: LinuxMint Description: Linux Mint 17.1 Rebecca Release: 17.1 Codename: rebecca
Note: I can get lsb_release -a to work on LinuxMint/Ubuntu computers but it does not work on CentOS.
Folks, as you’ve seen from the various options I’ve outlined above, there are several ways to bell a Linux distribution or kernel cat. 😉
Pick whichever one suits you best.