Display System Information Within Linux Using the "uname" Command

Print System Information With uname
Print System Information With uname.

Introduction

The uname command within Linux allows you to view system information about your Linux environment.

In this guide I will show you how to use uname effectively.

uname

The uname command on its own isn't particularly useful.

Try it for yourself. Open up a terminal window and type the following command:

uname

The chances are the only word that is returned is Linux.

Wow that is good isn't it. Unless you are using one of those distributions deliberately designed to look like other operating systems such as Zorin, Q4OS or Chromixium you probably already knew that.

 

uname -a

At the other end of the scale you can use the following command:

uname -a

This time you get a whole raft of information as follows:

  • kernel name
  • node name
  • kernel release
  • kernel version
  • machiine
  • processor
  • hardware platform
  • operating system

What you actually get is output which looks something like this:

Linux your-computer-name 3.19.0-32-generic #37-14.04.1-Ubuntu SMP Thu Oct 22 09:41:40 UTC 2015 x86_64 X86_64 x86_64 GNU/Linux

Obviously if I hadn't told you want the column contents were the information wouldn't have necessarily been that meaningful.

uname -s

The following command shows you the kernel name on its own.

uname -s

The output from this command is Linux but if you are on another platform such as BSD it will be different.

You can of course achieve the same results by not supplying the -s at all but it is worth remembering this switch in case the developers decide to change the default output for the uname command.

If you prefer to use a more reader friendly switch you can also use the following notation:

uname --kernel-name

The output is the same but your fingertips will now be a little bit shorter.

Incidentally if you are wondering what a kernel is then Wikipedia explains it nicely as follows:

The Linux kernel is a Unix-like computer operating system kernel. It is used world-wide: the Linux operating system is based on it and deployed on both traditional computer systems such as personal computers and servers, usually in the form of Linux distributions,[9] and on various embedded devices such as routers and NAS appliances. The Android operating system for tablet computerssmartphones and smartwatches is also based atop the Linux kernel.

uname -n

The following command shows you the node name of your computer:

uname -n

The output from the uname -n command is your computer's host name and you can achieve the same effect by typing the following into a terminal window:

hostname

You can also achieve the same effect by using the slightly more reader friendly command:

uname --nodename

The results are exactly the same and it is down to preference which one you go for. Note that hostname and nodename aren't guaranteed to be the same on non Linux systems.

uname -r

The following command shows you just the kernel release:

uname -r

The output of the above command will be something along the lines of 3.19.0-32-generic.

The kernel release is important when it comes to configuring hardware. Modern hardware isn't compatible with all releases and is usually included from a certain point onwards.

For example when version 1 of Linux was invented I doubt there was much call for drivers for 3d printers or touch screen displays. 

You can achieve the same effect by running the following command:

uname --kernel-release

uname -v

You can find the version of the Linux kernel you are running by typing the following command:

uname -v

The output of the version command will be something along the lines of #37~14.04.1.1-Ubuntu SMP Thu Oct 22 09:41:40 UTC 2015.

The kernel release differs from the version by the fact that the version shows you when the kernel was compiled and which version you are at.

For example Ubuntu might compile the 3.19.0-32-generic kernel 50 times. The first time they compile it the version will say #1 as well as the date it was compiled. Similarly on the 29th version it will say #29 as well as the date it was compiled. The Linux release is the same but the version is different.

You can get the same information by typing the following command:

uname --kernel-version

uname -m

The following command prints the machine hardware name:

uname -m

The result will look something like x86_64.

Incidentally if you run the uname -p and the uname -i command the result may well also be x86_64.

In the case of uname -m this is the machine architecture itself. Think about this at motherboard level.

You can get the same information by running the following command:

uname --machine

uname -p

The following command shows you the processor type:

uname -p

The result will more than likely be the same as the machine hardware name such as x86_64.

This command refers to the CPU type. 

You can achieve the same result by typing the following command:

uname --processor

uname -i

The following command shows you the hardware platform.

uname -i

This command will show the hardware platform or if you like the operating system type. You may for instance have an x86_64 platform and machine but only be running a 32-bit operating system.

You can achieve the same result by typing the following command:

uname --hardware-platform

uname -o

The following command shows you the operating system:

uname -o

If you are using a standard Linux desktop operating system such as Ubuntu, Debian etc then you won't be surprised to know that the output is GNU/Linux. On a phone or tablet the operating system would be Android.