uname - return system name
uname [snrvma]
By default, the uname utility will write the operating system name to standard output. When options are specified, symbols representing one or more system characteristics will be written to the standard output. The format and contents of the symbols are implementation-dependent. On systems conforming to the XSH specification, the symbols written will be those supported by the XSH specification uname() function.
The uname utility supports the XBD specification, Utility Syntax Guidelines .The following options are supported:
- -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-dependent 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 will write the operating system name, as if the -s option had been specified.
None.
Not used.
None.
The following environment variables affect the execution of uname:
- LANG
- Provide a default value for the internationalisation variables that are unset or null. If LANG is unset or null, the corresponding value from the implementation-dependent default locale will be used. If any of the internationalisation variables contains an invalid setting, the utility will behave as if none of the variables had been defined.
- LC_ALL
- If set to a non-empty string value, override the values of all the other internationalisation variables.
- LC_CTYPE
- Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single- as opposed to multi-byte characters in arguments).
- LC_MESSAGES
- Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.
- NLSPATH
- Determine the location of message catalogues for the processing of LC_MESSAGES .
Default.
By default, the output will be a single line of the following form:
"%s\n", <sysname>
If the -a option is specified, the output will be a single line of the following form:
"%s %s %s %s %s\n", <sysname>, <nodename>, <release>, <version>, <machine>Additional implementation-dependent symbols may be written; all such symbols will be written at the end of the line of output before the newline character.
If options are specified to select different combinations of the symbols, only those symbols will be written, in the order shown above for the -a option. If a symbol is not selected for writing, its corresponding trailing blank characters also will not be written.
Used only for diagnostic messages.
None.
None.
The following exit values are returned:
- 0
- The requested information was successfully written.
- >0
- An error occurred.
Default.
Note that any of the symbols could include embedded space characters, which may affect parsing algorithms if multiple options are selected for output.The node name is typically a name that the system uses to identify itself for intersystem communication addressing.
The following command:writes the operating system name and release level, separated by one or more blank characters.uname -sr
None.
The XSH specification description of uname().