System Information with uname

Most operating systems have a uname command which displays some simple system information.

On OS X it has the following documented parameters.

  • -a (will behave as if all the options below are specified)
  • -m (print machine hardware name)
  • -n (print machine name)
  • -p (print processor architecture name)
  • -r (print operating system release)
  • - s (print operating system name)
  • -v (print operating system version, actually prints whatever the system creator decides he wants there)
  • without parameters uname simply prints the operating system name

Here are some samples:

$ uname
QNX
$ uname -m
MSM8960_V3.2.1.1_F_R086_Rev:16
$ uname -p
armle
$ uname -r
8.0.0
$ uname -v
2014/02/09-15:22:47EST

This is QNX 8.0 on a little-endian ARM processor. Apparently the version was compiled in early February. This is actually my BlackBerry mobile phone running BlackBerry OS 10.2.

sh-3.2# uname
Darwin
sh-3.2# uname -m
x86_64
sh-3.2# uname -p
i386
sh-3.2# uname -r
13.1.0
sh-3.2# uname -v
Darwin Kernel Version 13.1.0: Thu Jan 16 19:40:37 PST 2014; root:xnu-2422.90.20~2/RELEASE_X86_64

This is Mac OS X (“Darwin”) Mavericks (10.9) running on a 64 bit Intel Mac. The machine type is given as x86_64 but oddly enough the processor architecture name is given as i386. I am assuming this was done for compatibility reasons. The release number is given as 13.1.0 which corresponds to 10.9.2 but Jobs knows why.

bash-4.2$ uname
Linux
bash-4.2$ uname -m
x86_64
bash-4.2$ uname -p
x86_64
bash-4.2$ uname -r
3.7.10-1.28
bash-4.2$ uname -v
#1 SMP PREEMPT Mon Feb 3 14:11:15 UTC 2014 (c9a2c6c)

This is a GNU/Linux box I have. Like my Mac it’s an x86_64 architecture but Linux’ uname also displays the processor architecture as x86_64 (which is correct). Note that both my OS X box and my Linux box run 64 bit kernels. The kernel version is here 3.7.10 and again the verbose -v string tells us when the kernel was compiled.

Just for comparison, this is a Linux/ARM box:

bash-4.2$ uname 
Linux
bash-4.2$ uname -m
armv7l
bash-4.2$ uname -p
unknown
bash-4.2$ uname -r
3.2.26
bash-4.2$ uname -v
#1 SMP Fri Dec 27 13:50:41 PST 2013

Linux kernel 3.2.26 running on an armv7l (an armv7 chip running in little-endian mode). Note that the processor string is again pretty useless. Apparently we must rely on machine type rather than processor type.

# uname
Minix
# uname -m
i686
# uname -p
i386
# uname -r
3.2.1
# uname -v
3.2.1

This is the output for my Minix box. Minix is a Unix clone like Linux, except smaller and used for educational purposes to teach operating systems. The verbose string does not show a date this time.

$ uname
VMkernel
$ uname -m
x86_64
$ uname -p
unknown
$ uname -r
5.5.0
$ uname -v
#1 SMP Release build-1331820 Sep 18 2013 23:08:31

And finally the big one. This is my VMware ESX 5.5 box. “VMkernel” ist the name of the ESX kernel.

 © Andrew Brehm 2016