xref: /illumos-gate/usr/src/man/man1/uname.1 (revision 533affcbc7fc4d0c8132976ea454aaa715fe2307)
1.\"
2.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3.\" permission to reproduce portions of its copyrighted documentation.
4.\" Original documentation from The Open Group can be obtained online at
5.\" http://www.opengroup.org/bookstore/.
6.\"
7.\" The Institute of Electrical and Electronics Engineers and The Open
8.\" Group, have given us permission to reprint portions of their
9.\" documentation.
10.\"
11.\" In the following statement, the phrase ``this text'' refers to portions
12.\" of the system documentation.
13.\"
14.\" Portions of this text are reprinted and reproduced in electronic form
15.\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16.\" Standard for Information Technology -- Portable Operating System
17.\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18.\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19.\" Engineers, Inc and The Open Group.  In the event of any discrepancy
20.\" between these versions and the original IEEE and The Open Group
21.\" Standard, the original IEEE and The Open Group Standard is the referee
22.\" document.  The original Standard can be obtained online at
23.\" http://www.opengroup.org/unix/online.html.
24.\"
25.\" This notice shall appear on any product containing this material.
26.\"
27.\" The contents of this file are subject to the terms of the
28.\" Common Development and Distribution License (the "License").
29.\" You may not use this file except in compliance with the License.
30.\"
31.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32.\" or http://www.opensolaris.org/os/licensing.
33.\" See the License for the specific language governing permissions
34.\" and limitations under the License.
35.\"
36.\" When distributing Covered Code, include this CDDL HEADER in each
37.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38.\" If applicable, add the following below this CDDL HEADER, with the
39.\" fields enclosed by brackets "[]" replaced with your own identifying
40.\" information: Portions Copyright [yyyy] [name of copyright owner]
41.\"
42.\"
43.\" Copyright 1989 AT&T
44.\" Portions Copyright (c) 1992, X/Open Company Limited  All Rights Reserved
45.\" Copyright (c) 2003, Sun Microsystems, Inc.  All Rights Reserved
46.\" Copyright 2018 Nexenta Systems, Inc.
47.\"
48.Dd February 9, 2018
49.Dt UNAME 1
50.Os
51.Sh NAME
52.Nm uname
53.Nd print name of current system
54.Sh SYNOPSIS
55.Nm
56.Op Fl aimnoprsvX
57.Nm
58.Fl S Ar system_name
59.Sh DESCRIPTION
60The
61.Nm
62utility prints information about the current system on the standard output.
63When options are specified, symbols representing one or more system
64characteristics will be written to the standard output.
65If no options are specified,
66.Nm
67prints the current operating system's name.
68The options print selected information returned by
69.Xr uname 2 ,
70.Xr sysinfo 2 ,
71or both.
72.Sh OPTIONS
73The following options are supported:
74.Bl -tag -width Ds
75.It Fl a
76Prints basic information currently available from the system.
77.It Fl i
78Prints the name of the platform.
79.It Fl m
80Prints the machine hardware name (class).
81Use of this option is discouraged.
82Use
83.Nm Fl p
84instead.
85See
86.Sx NOTES
87section below.
88.It Fl n
89Prints the nodename (the nodename is the name by which the system is known to a
90communications network).
91.It Fl o
92Prints the name of the kernel/OS.
93.It Fl p
94Prints the current host's ISA or processor type.
95.It Fl r
96Prints the operating system release level.
97.It Fl s
98Prints the name of the operating system.
99This is the default.
100.It Fl S Ar system_name
101The nodename may be changed by specifying a system name argument.
102The system name argument is restricted to
103.Dv SYS_NMLN
104characters.
105.Dv SYS_NMLN
106is an implementation specific value defined in
107.In sys/utsname.h .
108Only the super-user is allowed this capability.
109This change does not persist across reboots of the system.
110See
111.Xr nodename 5
112for details of how to change a host's name permanently.
113.It Fl v
114Prints the operating system version.
115.It Fl X
116Prints expanded system information, one information element per line, as
117expected by SCO UNIX.
118The displayed information includes:
119.Bl -bullet
120.It
121system name, node, release, version, machine, and number of CPUs.
122.It
123BusType, Serial, and Users (set to "unknown" in Solaris)
124.It
125OEM# and Origin# (set to 0 and 1, respectively)
126.El
127.El
128.Sh EXIT STATUS
129.Ex -std
130.Sh EXAMPLES
131.Bl -tag -width Ds
132.It Sy Example 1 No Printing the OS name and release level
133The following command:
134.Bd -literal
135$ uname -sr
136.Ed
137.Pp
138\&...prints the operating system name and release level, separated by one SPACE
139character.
140.El
141.Sh ENVIRONMENT VARIABLES
142See
143.Xr environ 7
144for descriptions of the following environment variables that affect the
145execution of
146.Nm :
147.Ev LANG , LC_ALL , LC_CTYPE , LC_MESSAGES ,
148and
149.Ev NLSPATH .
150.Sh INTERFACE STABILITY
151.Sy Standard
152.Sh SEE ALSO
153.Xr arch 1 ,
154.Xr isalist 1 ,
155.Xr sysinfo 2 ,
156.Xr uname 2 ,
157.Xr nodename 5 ,
158.Xr attributes 7 ,
159.Xr environ 7 ,
160.Xr standards 7
161.Sh NOTES
162Independent software vendors (ISVs) and others who need to determine detailed
163characteristics of the platform on which their software is either being
164installed or executed should use the
165.Nm
166command.
167.Pp
168To determine the operating system name and release level, use
169.Nm Fl sr .
170To determine only the operating system release level, use
171.Nm Fl r .
172Notice that operating system release levels are not guaranteed to be in
173.Em x.y
174format (such as 5.3, 5.4, 5.5, and so forth); but could be in the
175.Em x.y.z
176format (such as 5.5.1).
177.Pp
178In SunOS 4.x releases, the
179.Xr arch 1
180command was often used to obtain information similar to that obtained by using
181the
182.Nm
183command.
184The
185.Xr arch 1
186command output
187.Ql sun4
188was often incorrectly interpreted to signify a SunOS SPARC system.
189If hardware platform information is desired, use
190.Nm Fl sp .
191.Pp
192The
193.Nm arch Fl k
194and
195.Nm Fl m
196commands return equivalent values; however, the use of either of these commands
197by third party programs is discouraged, as is the use of the
198.Nm arch
199command in general.
200To determine the machine's Instruction Set Architecture (ISA or processor type),
201use
202.Nm
203with the
204.Fl p
205option.
206