Uname command with examples

  • by

1. uname command

The uname command prints information about the system. uname is a portmanteau word made up from "unix" and "name". uname can be called from the command line in Linux as,

uname [OPTION]...

The most common way to use uname is with the -a option, which stands for "all" the information.

$ uname -a
Linux flute 5.0.0-32-generic #34~18.04.2-Ubuntu SMP Thu Oct 10 10:36:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

The contents of the above output, as given by the info command are, kernel-name, node-name, kernel-release, kernel-version, machine, processor, hardware-platform and the operating-system respectively. So we can say that the above uname -a output indicates the following information about the system:

kernel-name: Linux
node-name: flute
kernel-release: 5.0.0-32-generic
kernel-version: #34~18.04.2-Ubuntu SMP Thu Oct 10 10:36:02 UTC 2019
machine: x86_64
processor: x86_64
hardware-platform: x86_64
operating-system: GNU/Linux

The kernel-release is the release name of the Linux kernel as published on sites like the Linux Kernel Archives. The kernel-version relates to the Linux distribution. So, in this case, it tells that the kernel version is #34~18.04.2-Ubuntu SMP, compiled at Oct 10, 2019, 10:36:02 UTC.

2. uname command examples

2.1 uname

The uname command without any argument prints the kernel name. uname, with the -s option for "system", does the same.

$ uname
Linux
$ uname -s
Linux

2.2 uname -n

uname, with the -n option, prints the network node hostname of the system.

$ uname -n
flute

2.3 uname -r

The -r option prints the kernel release of the system.

$ uname -r
5.0.0-32-generic

2.4 uname -v

The -v option prints the kernel version of the system.

$ uname -v
#34~18.04.2-Ubuntu SMP Thu Oct 10 10:36:02 UTC 2019

2.5 uname -m

With the -m option prints the machine hardware name of the system.

$ uname -m
x86_64

2.6 uname -p

With the -p option prints the processor type of the system. This a non-portable option and might not work in many non-Linux systems.

$ uname -p
x86_64

2.7 uname -i

With the -i option prints the hardware platform of the system. This a non-portable option and might not work in many non-Linux systems.

$ uname -i
x86_64

2.8 uname -o

With the -o option prints the operating system of the system. This a non-portable option and might not work in many non-Linux systems.

$ uname -o
GNU/Linux
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

You may like these, also

  • POSIX message queues in LinuxPOSIX message queues in Linux 1.0 POSIX Message queues POSIX interprocess comunication (IPC) was introduced in the POSIX.1b standard (IEEE Std 1003.1b-1993) for real time…
  • POSIX Shared Memory in LinuxPOSIX Shared Memory in Linux 1.0 Shared Memory Shared memory is the fastest method of interprocess communication (IPC) under Linux and other Unix-like systems. The…
  • POSIX Semaphores in LinuxPOSIX Semaphores in Linux 1.0 Semaphores Semaphores are used for process and thread synchronization. Semaphores are clubbed with message queues and shared memory under…
  • fork and exec system calls in Linuxfork and exec system calls in Linux 1.0 fork and exec system calls Suppose we wish to write a "shell program" which would execute another program. Now,…
  • Connecting two computers with Ethernet LAN cableConnecting two computers with Ethernet LAN cable Quite often, we wish to connect two computers back to back using an Ethernet LAN cable. It may be because…
  • D-Bus TutorialD-Bus Tutorial 1.0 D-Bus D-Bus is a mechanism for interprocess communication under Linux and other Unix-like systems. D-Bus has a layered architecture.…
  • Socket programming using the select system callSocket programming using the select system call 1.0 Client-Server Paradigm The Client-Server paradigm divides the software architecture of a system in two parts, the server and its…
  • System V message queues in LinuxSystem V message queues in Linux 1.0 Message queues Message queues are one of the interprocess communication mechanisms available under Linux. Message queues, shared memory and…
  • POSIX Threads Synchronization in CPOSIX Threads Synchronization in C 1.0 POSIX Threads Synchronization POSIX Threads provide multiple flows of execution within a process. The threads have their own stacks…
  • System V Shared Memory in LinuxSystem V Shared Memory in Linux 1.0 Shared Memory Shared memory is one of the three interprocess communication (IPC) mechanisms available under Linux and other Unix-like…