uname (short for unix name) is a software program in Unix and Unix-like computer operating systems that prints the name, version and other details about the current machine and the operating system running on it. The uname system call and command appeared for the first time in PWB/UNIX.
Some Unix variants, such as AT&TUNIX System V Release 3.0 include the related setname program, used to change the values that uname reports.
Description: By default, the uname utility shall write the operating system name to standard output. When options are specified, symbols representing one or more system characteristics shall be written to the standard output. The format and contents of the symbols are implementation-defined. On systems conforming to the System Interfaces volume of POSIX.1-2008, the symbols written shall be those supported by the uname() function as defined in the System Interfaces volume of POSIX.1-2008. [1]
The uname utility shall conform to the Base Definitions volume of IEEE Std 1003.1-2001, Section 12.2, Utility Syntax Guidelines. [2]
The following options shall be supported:
Option
Description
-a
Behave as though all of the options -mnrsv were specified.
-m
Write the name of the hardware type on which the system is running to standard output.
-n
Write the name of this node within an implementation-defined communications network.
-r
Write the current release level of the operating system implementation.
-s
Write the name of the implementation of the operating system.
-v
Write the current version level of this release of the operating system implementation.
If no options are specified, the uname utility shall write the operating system name, as if the -s option had been specified.
GNU version
The GNU version of uname has been modified from the POSIX/IEEE standard to support GNU/Linux marketing [3]. For example, the -o option does not exist on non-GNU versions of uname. The GNU version has modified descriptions of options as well. [4]
Option
Description
-a, --all
print all information, in the following order, except omit -p and -i if unknown
-s, --kernel-name
print the kernel name
-n, --nodename
print the network node hostname
-r, --kernel-release
print the kernel release
-v, --kernel-version
print the kernel version
-m, --machine
print the machine hardware name
-p, --processor
print the processor type or "unknown"
-i, --hardware-platform
print the hardware platform or "unknown"
-o, --operating-system
print the operating system
The GNU version of uname is included in the "sh-utils" or "coreutils" packages. GNU uname itself is not available as a standalone program.
Commands on other software systems
The ver command found in software systems such as DOS, OS/2 and Microsoft Windows is similar to the uname command on UNIX-systems.
Examples of uname
The output from running uname with the -acommand line argument or ver might look like the text below:
On a software system running Darwin operating system
Darwin hostname 9.2.0 Darwin Kernel Version 9.2.0: Tue Feb 5 16:13:22 PST 2008; root:xnu-1228.3.13~1/RELEASE_I386 i386
On a software system running Linux operating system
Linux hostname 2.6.24-19-server #1 SMP Sat Jul 12 00:40:01 UTC 2008 i686 GNU/Linux
A ver command on Windows 7 (beta) system running NT6.1 operating system
Microsoft Windows [Version 6.1.7000]
Table of standard uname output
The following table contains examples from various versions of uname -mnrsv on various platforms as standard output is asked if needed. These are merely meant to broadly represent common results; actual output may vary depending on hardware type, OS version, used uname (GNU or Standard) version and which software patches have been installed.
Internet browsers have the "User Agent" function, to tell the server information about the operating system, platform, and hardware on which they are running [5]. Some of this information is gathered from the uname or ver application. For example, Konqueror 4.2.1 allows the user to select to send a:
Add operating system name (uname -s)
Add operating system version (uname -r)
Add platform name
Add machine (processor) type (uname -m)
Example of information when these are selected:
Mozilla/5.0 (compatible; Konqueror/4.2; Linux 2.6.29-desktop-0.rc6.1.1mnb; X11; i686) KHTML/4.2.1 (like Gecko)
With this information, corporations collect information to calculate various things, for example: the market share of operating systems, although this kind information is not always sent by default. However, because False User Agent information can be sent to the server, this information is usually not trustworthy, even for statistics.