uname (host)
Return the name of the operating system (POSIX)
Syntax:
uname [-akmnprsv] [-S name]
Runs on:
Microsoft Windows
Options:
- -a
- Behave as if the options -snrvmp were specified.
- -k
- Write the release level of the operating system (see the -r option) and the version number of the kernel.
- -m
- Write the name of the hardware type on which the system is running.
- -n
- Write the name of this node.
- -p
- Write the processor name.
- -r
- Write the current release level of the operating system (indicated by a number).
If you're running a safety version of the kernel, the release level includes an uppercase
S
. - -S name
- Set the host name.
- -s
- Write the name of the operating system.
- -v
- Write the current version level of this release of the operating system (indicated by a timestamp).
Description:
The uname utility writes to standard output information on the name and release of the operating system being run. A portable application may use uname on any POSIX system to determine what operating system it's running under.
If you don't specify any options, uname writes the operating system name
(QNX
).
Examples:
Write the operating system name:
uname
Write a formatted string showing the name, release level, and version level of the operating system:
printf "OS: %s release %s version %s\n" $(uname -srv)
Exit status:
- 0
- Success
- > 0
- An error occurred.
Caveats:
The pidin utility provides more detailed information than uname, but pidin is a QNX OS utility and isn't present on other systems.