1UNAME(1P)                  POSIX Programmer's Manual                 UNAME(1P)
2
3
4

PROLOG

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

NAME

12       uname - return system name
13

SYNOPSIS

15       uname [-snrvma]
16

DESCRIPTION

18       By default, the uname utility shall write the operating system name  to
19       standard  output.  When options are specified, symbols representing one
20       or more system characteristics shall be written to the standard output.
21       The  format  and contents of the symbols are implementation-defined. On
22       systems   conforming   to   the    System    Interfaces    volume    of
23       IEEE Std 1003.1-2001,  the  symbols written shall be those supported by
24       the uname() function as defined in  the  System  Interfaces  volume  of
25       IEEE Std 1003.1-2001.
26

OPTIONS

28       The  uname  utility  shall  conform  to  the Base Definitions volume of
29       IEEE Std 1003.1-2001, 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  run‐
36              ning 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  imple‐
42              mentation.
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 operating
47              system implementation.
48
49
50       If no options are specified, the uname utility shall write the  operat‐
51       ing system name, as if the -s option had been specified.
52

OPERANDS

54       None.
55

STDIN

57       Not used.
58

INPUT FILES

60       None.
61

ENVIRONMENT VARIABLES

63       The  following  environment  variables  shall  affect  the execution of
64       uname:
65
66       LANG   Provide a default value for the  internationalization  variables
67              that  are  unset  or  null.  (See the Base Definitions volume of
68              IEEE Std 1003.1-2001, Section  8.2,  Internationalization  Vari‐
69              ables  for the precedence of internationalization variables used
70              to determine the values of locale categories.)
71
72       LC_ALL If set to a non-empty string value, override the values  of  all
73              the other internationalization variables.
74
75       LC_CTYPE
76              Determine  the  locale  for  the  interpretation of sequences of
77              bytes of text data as characters (for  example,  single-byte  as
78              opposed to multi-byte characters in arguments).
79
80       LC_MESSAGES
81              Determine  the  locale  that should be used to affect the format
82              and contents of diagnostic messages written to standard error.
83
84       NLSPATH
85              Determine the location of message catalogs for the processing of
86              LC_MESSAGES .
87
88

ASYNCHRONOUS EVENTS

90       Default.
91

STDOUT

93       By default, the output shall be a single line of the following form:
94
95
96              "%s\n", <sysname>
97
98       If the -a option is specified, the output shall be a single line of the
99       following form:
100
101
102              "%s %s %s %s %s\n", <sysname>, <nodename>, <release>,
103                  <version>, <machine>
104
105       Additional implementation-defined symbols may be written; all such sym‐
106       bols shall be written at the end of the line of output before the <new‐
107       line>.
108
109       If options are specified to select different combinations of  the  sym‐
110       bols, only those symbols shall be written, in the order shown above for
111       the -a option. If a symbol is not selected for writing, its correspond‐
112       ing trailing <blank>s also shall not be written.
113

STDERR

115       The standard error shall be used only for diagnostic messages.
116

OUTPUT FILES

118       None.
119

EXTENDED DESCRIPTION

121       None.
122

EXIT STATUS

124       The following exit values shall be returned:
125
126        0     The requested information was successfully written.
127
128       >0     An error occurred.
129
130

CONSEQUENCES OF ERRORS

132       Default.
133
134       The following sections are informative.
135

APPLICATION USAGE

137       Note that any of the symbols could include embedded <space>s, which may
138       affect parsing algorithms if multiple options are selected for output.
139
140       The node name is typically a name that  the  system  uses  to  identify
141       itself for inter-system communication addressing.
142

EXAMPLES

144       The following command:
145
146
147              uname -sr
148
149       writes the operating system name and release level, separated by one or
150       more <blank>s.
151

RATIONALE

153       It was suggested that this utility cannot be used  portably  since  the
154       format  of  the  symbols is implementation-defined. The POSIX.1 working
155       group could not achieve consensus on  defining  these  formats  in  the
156       underlying  uname()  function,  and  there was no expectation that this
157       volume of IEEE Std 1003.1-2001  would  be  any  more  successful.  Some
158       applications may still find this historical utility of value. For exam‐
159       ple, the symbols could be used for system log entries or for comparison
160       with operator or user input.
161

FUTURE DIRECTIONS

163       None.
164

SEE ALSO

166       The System Interfaces volume of IEEE Std 1003.1-2001, uname()
167
169       Portions  of  this text are reprinted and reproduced in electronic form
170       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
171       --  Portable  Operating  System  Interface (POSIX), The Open Group Base
172       Specifications Issue 6, Copyright (C) 2001-2003  by  the  Institute  of
173       Electrical  and  Electronics  Engineers, Inc and The Open Group. In the
174       event of any discrepancy between this version and the original IEEE and
175       The  Open Group Standard, the original IEEE and The Open Group Standard
176       is the referee document. The original Standard can be  obtained  online
177       at http://www.opengroup.org/unix/online.html .
178
179
180
181IEEE/The Open Group                  2003                            UNAME(1P)
Impressum