How to check Unix version using command line

Unix is operating systems from various IT vendors. Unix is a multi-user and multitasking network operating system. AT&T labs created it. Some of the most popular Unix variants are macOS, HP-UX, Solaris, AIX. We also have Unix-like operating systems descended from the Berkeley Software Distribution (BSD) such as FreeBSD, NetBSD, and OpenBSD. Please note that Linux is not Unix but its clone (Unix-like).

This page explains how to check what Unix variant and version currently installed on your computer using the command-line options.
Tutorial details
Difficulty level Easy
Root privileges No
Requirements Unix terminal app
Est. reading time 2 minutes
We have various commands that help us to find out the Unix variant, type, and machine. The most common Unix command is uname, and we will talk about it first, followed by variant-specific information.

Checking Unix version

  1. Open the terminal application and then type the following uname command:
    uname
    uname -a
  2. Display the current release level (OS Version) of the Unix operating system.
    uname -r
  3. You will see Unix OS version on screen. To see architecture of Unix, run:
    uname -m

Here is outputs from my FreeBSD Unix server:
Finding Unix version using commands

Examples

Although uname available on all Unix variants, there are other ways to display OS versions and names. Let us look at operating system-specific information.

How to check FreeBSD unix version

Type the following command to determine the version and patch level:
freebsd-version
freebsd-version -k
freebsd-version -r
freebsd-version -u

Show FreeBSD Unix Version

A note about macOS

Open the macOS Terminal app and then type any one of the following command to print macOS or Mac OS X version:
sw_vers
# OR #
system_profiler SPSoftwareDataType

HP-UX Unix

Use the swlist command as follows for determining your HP-UX Unix system version:
swlist
swlist | grep -i oe
swlist HPUX*OE*
swlist HPUX*OE*

You will see something as follows:

HPUX11i-OE-Ent B.11.23.0606 HP-UX Enterprise Operating Environment Component

OR

HPUX11i-TCOE B.11.23.0409 HP-UX Technical Computing OE Component

To see machine model from HP, type:
model
machinfo
getconf MACHINE_MODEL

Oracle or Sun Solaris OS

Verifying Operating system version on Oracle or Sun Solaris Unix is easy:
uname
uname -a
uname -r
# use the cat command #
cat /etc/release

You will get info such as Oracle Solaris 11 (5.11) OR Oracle Solaris 11.1 SPARC.

IBM AIX Unix

To view the base level of the Unix system OS from IBM, type:
uname
uname -a
uname -r
oslevel
prtconf

See oslvel AIX command man-page for more info.

Summing up

The uname and other Unix command commands can help you determine information about your Unix server or desktop, including its hardware type, machine model, operating system version. The uname and other options various. Hence, see the following man pages:
man uname
See also:


🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 0 comments... add one


CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
0 comments… add one

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum