1UNAME(P) POSIX Programmer's Manual UNAME(P)
2
3
4
6 uname - return system name
7
9 uname [-snrvma]
10
12 By default, the uname utility shall write the operating system name to
13 standard output. When options are specified, symbols representing one
14 or more system characteristics shall be written to the standard output.
15 The format and contents of the symbols are implementation-defined. On
16 systems conforming to the System Interfaces volume of
17 IEEE Std 1003.1-2001, the symbols written shall be those supported by
18 the uname() function as defined in the System Interfaces volume of
19 IEEE Std 1003.1-2001.
20
22 The uname utility shall conform to the Base Definitions volume of
23 IEEE Std 1003.1-2001, Section 12.2, Utility Syntax Guidelines.
24
25 The following options shall be supported:
26
27 -a Behave as though all of the options -mnrsv were specified.
28
29 -m Write the name of the hardware type on which the system is run‐
30 ning to standard output.
31
32 -n Write the name of this node within an implementation-defined
33 communications network.
34
35 -r Write the current release level of the operating system imple‐
36 mentation.
37
38 -s Write the name of the implementation of the operating system.
39
40 -v Write the current version level of this release of the operating
41 system implementation.
42
43
44 If no options are specified, the uname utility shall write the operat‐
45 ing system name, as if the -s option had been specified.
46
48 None.
49
51 Not used.
52
54 None.
55
57 The following environment variables shall affect the execution of
58 uname:
59
60 LANG Provide a default value for the internationalization variables
61 that are unset or null. (See the Base Definitions volume of
62 IEEE Std 1003.1-2001, Section 8.2, Internationalization Vari‐
63 ables for the precedence of internationalization variables used
64 to determine the values of locale categories.)
65
66 LC_ALL If set to a non-empty string value, override the values of all
67 the other internationalization variables.
68
69 LC_CTYPE
70 Determine the locale for the interpretation of sequences of
71 bytes of text data as characters (for example, single-byte as
72 opposed to multi-byte characters in arguments).
73
74 LC_MESSAGES
75 Determine the locale that should be used to affect the format
76 and contents of diagnostic messages written to standard error.
77
78 NLSPATH
79 Determine the location of message catalogs for the processing of
80 LC_MESSAGES .
81
82
84 Default.
85
87 By default, the output shall be a single line of the following form:
88
89
90 "%s\n", <sysname>
91
92 If the -a option is specified, the output shall be a single line of the
93 following form:
94
95
96 "%s %s %s %s %s\n", <sysname>, <nodename>, <release>,
97 <version>, <machine>
98
99 Additional implementation-defined symbols may be written; all such sym‐
100 bols shall be written at the end of the line of output before the <new‐
101 line>.
102
103 If options are specified to select different combinations of the sym‐
104 bols, only those symbols shall be written, in the order shown above for
105 the -a option. If a symbol is not selected for writing, its correspond‐
106 ing trailing <blank>s also shall not be written.
107
109 The standard error shall be used only for diagnostic messages.
110
112 None.
113
115 None.
116
118 The following exit values shall be returned:
119
120 0 The requested information was successfully written.
121
122 >0 An error occurred.
123
124
126 Default.
127
128 The following sections are informative.
129
131 Note that any of the symbols could include embedded <space>s, which may
132 affect parsing algorithms if multiple options are selected for output.
133
134 The node name is typically a name that the system uses to identify
135 itself for inter-system communication addressing.
136
138 The following command:
139
140
141 uname -sr
142
143 writes the operating system name and release level, separated by one or
144 more <blank>s.
145
147 It was suggested that this utility cannot be used portably since the
148 format of the symbols is implementation-defined. The POSIX.1 working
149 group could not achieve consensus on defining these formats in the
150 underlying uname() function, and there was no expectation that this
151 volume of IEEE Std 1003.1-2001 would be any more successful. Some
152 applications may still find this historical utility of value. For exam‐
153 ple, the symbols could be used for system log entries or for comparison
154 with operator or user input.
155
157 None.
158
160 The System Interfaces volume of IEEE Std 1003.1-2001, uname()
161
163 Portions of this text are reprinted and reproduced in electronic form
164 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
165 -- Portable Operating System Interface (POSIX), The Open Group Base
166 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
167 Electrical and Electronics Engineers, Inc and The Open Group. In the
168 event of any discrepancy between this version and the original IEEE and
169 The Open Group Standard, the original IEEE and The Open Group Standard
170 is the referee document. The original Standard can be obtained online
171 at http://www.opengroup.org/unix/online.html .
172
173
174
175IEEE/The Open Group 2003 UNAME(P)