1UNAME(1P) POSIX Programmer's Manual UNAME(1P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
11
13 uname — return system name
14
16 uname [−amnrsv]
17
19 By default, the uname utility shall write the operating system name to
20 standard output. When options are specified, symbols representing one
21 or more system characteristics shall be written to the standard output.
22 The format and contents of the symbols are implementation-defined. On
23 systems conforming to the System Interfaces volume of POSIX.1‐2008, the
24 symbols written shall be those supported by the uname() function as
25 defined in the System Interfaces volume of POSIX.1‐2008.
26
28 The uname utility shall conform to the Base Definitions volume of
29 POSIX.1‐2008, Section 12.2, Utility Syntax Guidelines.
30
31 The following options shall be supported:
32
33 −a Behave as though all of the options −mnrsv were specified.
34
35 −m Write the name of the hardware type on which the system is
36 running to standard output.
37
38 −n Write the name of this node within an implementation-defined
39 communications network.
40
41 −r Write the current release level of the operating system
42 implementation.
43
44 −s Write the name of the implementation of the operating system.
45
46 −v Write the current version level of this release of the oper‐
47 ating system implementation.
48
49 If no options are specified, the uname utility shall write the operat‐
50 ing system name, as if the −s option had been specified.
51
53 None.
54
56 Not used.
57
59 None.
60
62 The following environment variables shall affect the execution of
63 uname:
64
65 LANG Provide a default value for the internationalization vari‐
66 ables that are unset or null. (See the Base Definitions vol‐
67 ume of POSIX.1‐2008, Section 8.2, Internationalization Vari‐
68 ables for the precedence of internationalization variables
69 used to determine the values of locale categories.)
70
71 LC_ALL If set to a non-empty string value, override the values of
72 all the other internationalization variables.
73
74 LC_CTYPE Determine the locale for the interpretation of sequences of
75 bytes of text data as characters (for example, single-byte as
76 opposed to multi-byte characters in arguments).
77
78 LC_MESSAGES
79 Determine the locale that should be used to affect the format
80 and contents of diagnostic messages written to standard
81 error.
82
83 NLSPATH Determine the location of message catalogs for the processing
84 of LC_MESSAGES.
85
87 Default.
88
90 By default, the output shall be a single line of the following form:
91
92 "%s\n", <sysname>
93
94 If the −a option is specified, the output shall be a single line of the
95 following form:
96
97 "%s %s %s %s %s\n", <sysname>, <nodename>, <release>,
98 <version>, <machine>
99
100 Additional implementation-defined symbols may be written; all such sym‐
101 bols shall be written at the end of the line of output before the <new‐
102 line>.
103
104 If options are specified to select different combinations of the sym‐
105 bols, only those symbols shall be written, in the order shown above for
106 the −a option. If a symbol is not selected for writing, its correspond‐
107 ing trailing <blank> characters also shall not be written.
108
110 The standard error shall be used only for diagnostic messages.
111
113 None.
114
116 None.
117
119 The following exit values shall be returned:
120
121 0 The requested information was successfully written.
122
123 >0 An error occurred.
124
126 Default.
127
128 The following sections are informative.
129
131 Note that any of the symbols could include embedded <space> characters,
132 which may affect parsing algorithms if multiple options are selected
133 for output.
134
135 The node name is typically a name that the system uses to identify
136 itself for inter-system communication addressing.
137
139 The following command:
140
141 uname −sr
142
143 writes the operating system name and release level, separated by one or
144 more <blank> characters.
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 POSIX.1‐2008 would be any more successful. Some applications
152 may still find this historical utility of value. For example, the sym‐
153 bols could be used for system log entries or for comparison with opera‐
154 tor or user input.
155
157 None.
158
160 The Base Definitions volume of POSIX.1‐2008, Chapter 8, Environment
161 Variables, Section 12.2, Utility Syntax Guidelines
162
163 The System Interfaces volume of POSIX.1‐2008, uname()
164
166 Portions of this text are reprinted and reproduced in electronic form
167 from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
168 -- Portable Operating System Interface (POSIX), The Open Group Base
169 Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
170 cal and Electronics Engineers, Inc and The Open Group. (This is
171 POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the
172 event of any discrepancy between this version and the original IEEE and
173 The Open Group Standard, the original IEEE and The Open Group Standard
174 is the referee document. The original Standard can be obtained online
175 at http://www.unix.org/online.html .
176
177 Any typographical or formatting errors that appear in this page are
178 most likely to have been introduced during the conversion of the source
179 files to man page format. To report such errors, see https://www.ker‐
180 nel.org/doc/man-pages/reporting_bugs.html .
181
182
183
184IEEE/The Open Group 2013 UNAME(1P)