uname

Print the Darwin OS Kernel version / release / machine name.

Syntax
      uname [-amnpsrv]

Options
     -a      Behave as though all of the options -mnrsv were specified.

     -m      Print the machine hardware name.

     -n      Print the nodename (the nodename may be a name that the system is
             known by to a communications network).

     -p      Print the generic processor type.

     -s      Print the operating system name.
             This is the default if no other options are specified.

     -r      Print the operating system release.

     -v      Print the operating system version.

The version data includes either i386 or X86_64 indicating a 32 or 64 bit kernel.

During system boot you can hold down '6' and '4' to load the 64 bit kernel or hold down '3' and '2' to use the 32 bit kernel.
Your machine will default into the kernel that is best supported.

Examples

$ uname -m
i386

$ uname -v
Darwin Kernel Version 16.7.0: Thu Dec 20 21:53:35 PST 2018; root:xnu-3789.73.31~1/RELEASE_X86_64

Check if we are running a 64 bit kernel:

 OS=$(uname -m) 
 case $OS in
    (amd64|x86_64)   bits=64 ;;    
    (i386|i586|i686) bits=32 ;;
    (*) bits=unknown         ;;
 esac  
 echo "You have a ${bits}-bit machine."

“I have discovered the art of deceiving diplomats. I tell them the truth and they never believe me” ~ Camillo Di Cavour

Related macOS commands:

hostname - Print or set system name.
serverinfo - Server information.


Copyright © SS64.com 1999-2019
Some rights reserved