uname Command

Purpose

Displays the name of the current operating system.

Syntax

uname [ -a | -x | -S Name ] [ -F ] [ -f ] [ -l ] [ -L ] [ -m ] [ -M ] [ -n ] [ -p ] [ -r ] [ -s | V] [ -T Name ] [ -u ] [ -v ] [ -W ]

Description

The uname command writes to standard output the name of the operating system that you are using.

The machine ID number contains 12 characters in the following digit format: xxyyyyyymmss. The xx positions indicate the system and is always 00. The yyyyyy positions contain the unique ID number for the entire system. The mm position represents the model ID. The ss position is the submodel number and is always 00. The model ID describes the ID of the CPU Planar, not the model of the System as a whole.

Most machines share a common model ID of 4C.

The machine identifier value returned by the uname command may change when new operating system software levels are installed. This change affects applications using this value to access licensed programs. To view this identifier, enter the uname -m command.

Contact the appropriate support organization if your application is affected.

Flags

Item Description
-a Displays all information specified with the -m, -n, -r, -s, and -v flags. Cannot be used with the -x or -SName flag. If the -x flag is specified with the -a flag, the -x flag overrides it.
-F Displays a system identification string comprised of hexadecimal characters. This identification string is the same for all partitions on a particular system.
-f Similar to the F flag, except that the partition number is also used in the calculation of this string. The resulting identification string is unique for each partition on a particular system.
-l Displays the LAN network number.
-L Displays LPAR number and LPAR name. If LPAR does not exist, -1 is displayed for LPAR number and NULL for LPAR name. If a system is capable of LPAR, but is currently running in Symmetric Multi Processing (SMP) mode, 1 is displayed for LPAR number and NULL for LPAR name.
-m Displays the machine ID number of the hardware running the system.
Note: The -m flag cannot be used to generate a unique machine identifier for partitions in an LPAR environment.
-M Displays the system model name. If the model name attribute does not exist, a null string is displayed.
-n Displays the name of the node. This may be a name the system is known by to a UUCP communications network.
-p Displays the architecture of the system processor.
-r Displays the release number of the operating system.
-s Displays the system name. This flag is on by default. The -s option is mutually exclusive with the -V option.
-V Displays the VIOS Complete version detail if ran in a LPAR that contains VIOS, else displays details of the AIX operating system. The –V option is mutually exclusive with the -s option.
-S Name Sets the name of the node. This can be the UUCP communications network name for the system.
-T Name Sets the system name. This can be the UUCP communications network name for the system.
-u Displays the system ID number. If this attribute is not defined, the output is the same as the output displayed by uname -m.
-v Displays the operating system version.
-W Displays the static workload partition identification number. If the uname command runs in the Global environment, a value of zero is displayed.
-x Displays the information specified with the -a flag as well as the LAN network number, as specified by the -l flag.

If you enter a flag that is not valid, the uname command exits with an error message, an error return status, and no output.

Note: The uname command does not preserve the new system name and node name values across system reboot.

Exit Status

This command returns the following exit values:

Item Description
0 The requested information was successfully written.
>0 An error occurred.

Security

Attention RBAC users and Trusted AIX users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.

Example

To display the complete system name and version banner, enter:

uname  -a

Files

Item Description
/usr/bin/uname Contains the uname command.