uname
uname is both a system function ( uname()
) and a system program ( /usr/bin/uname
) in UNIX and UNIX-like operating systems . The function and program provide the name and further information about the operating system. The presence and behavior of both the function and the program, along with its options, are standardized in POSIX .
The function returns the information as struct
, the form of sys/utsname.h
which is specified in.
The command outputs the information to <stdout>
. The form and content of the output are not standardized for both the function and the command.
Implementations
Function and program were implemented for the first time in PWB / UNIX . Some Unix variants, for example AT&T UNIX System V Release 3.0, also contain the program setname
with which the values that uname
are returned can be changed.
In the man pages of the FreeBSD , OpenBSD , NetBSD systems , the POSIX conformity of their implementation of the program is uname
claimed.
The manual documents of the GNU implementation of the program do not explicitly indicate POSIX conformity, but state for the option -s
that the kernel name is output as the content instead of the operating system name . The POSIX specification does not recognize the term kernel , but this behavior - as described at the beginning - does not explicitly contradict it.
example
On a system with Darwin , the output of the command uname
with the option -a
( set all available options ) might look like this:
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
Similar programs in other operating systems
In macOS , the command sw_vers
can also be used to output information about the system.
In MS-DOS and its descendants (e.g. Windows ) the command is used ver
to query the version. In VMS or OpenVMS , F$GETSYI
if parameterized accordingly, similar information can be provided about the running system.
Individual evidence
- ↑ a b Open Group Base Specifications Issue 7, 2018 edition, Functions (engl.)
- ↑ a b Open Group Base Specifications Issue 7, 2018 edition, Shell & Utilities (engl.)
- ↑ FreeBSD General Commands Manual. FreeBSD , accessed July 8, 2018 .
- ↑ OpenBSD General Commands Manual. OpenBSD , accessed July 8, 2018 .
- ↑ NetBSD General Commands Manual. NetBSD , accessed July 8, 2018 .