Display System Information Within Linux Using the uname Command

Find system info quickly from the command line

Print System Information With uname
Print System Information With uname.

The uname command within Linux allows you to view system information about your Linux environment. Here's how to use uname effectively.

Getting Started With 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. 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

Linux uname all

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

  • kernel name
  • node name
  • kernel release
  • kernel version
  • machine
  • 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 we hadn't told you to want the column contents meant, 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.

Linux uname system

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 – it's the smallest amount of replaceable software that can interact with your computer – Wikipedia explains it in more detail:

The Linux kernel is a Unix-like computer operating system kernel. It is used worldwide: 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 computers, smartphones and smartwatches is also based atop the Linux kernel.

uname -n

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

uname -n

Linux uname nodename

The output from the uname -n command is your computer's hostname 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.

Linux uname kernel release

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 there wasn't 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.

Linux uname kernel version

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.

Linux uname machine architecture

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

Linux uname operating system

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.