xref: /freebsd/usr.bin/uname/uname.1 (revision 734e82fe33aa764367791a7d603b383996c6b40b)
1.\" Copyright (c) 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 3. Neither the name of the University nor the names of its contributors
13.\"    may be used to endorse or promote products derived from this software
14.\"    without specific prior written permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\"	@(#)uname.1	8.3 (Berkeley) 4/8/94
29.\"
30.Dd September 14, 2022
31.Dt UNAME 1
32.Os
33.Sh NAME
34.Nm uname
35.Nd display information about the system
36.Sh SYNOPSIS
37.Nm
38.Op Fl abiKmnoprsUv
39.Sh DESCRIPTION
40The
41.Nm
42command writes the name of the operating system implementation to
43standard output.
44When options are specified, strings representing one or more system
45characteristics are written to standard output.
46.Pp
47The options are as follows:
48.Bl -tag -width indent
49.It Fl a
50Behave as though the options
51.Fl m , n , r , s ,
52and
53.Fl v
54were specified.
55.It Fl b
56Write the kernel's linker-generated build-id to standard output.
57.It Fl i
58Write the kernel ident to standard output.
59.It Fl K
60Write the
61.Fx
62version of the kernel.
63.It Fl m
64Write the type of the current hardware platform to standard output.
65.Po Xr make 1
66uses it to set the
67.Va MACHINE
68variable.
69.Pc
70.It Fl n
71Write the name of the system to standard output.
72.It Fl o
73This is a synonym for the
74.Fl s
75option, for compatibility with other systems.
76.It Fl p
77Write the type of the machine processor architecture to standard output.
78.Po Xr make 1
79uses it to set the
80.Va MACHINE_ARCH
81variable.
82.Pc
83.It Fl r
84Write the current release level of the kernel
85to standard output.
86.Xr freebsd-version 1
87can be used to print the release level of the userland.
88.It Fl s
89Write the name of the operating system implementation to standard output.
90.It Fl U
91Write the
92.Fx
93version of the user environment.
94.It Fl v
95Write the version level of this release of the operating system
96to standard output.
97.El
98.Pp
99If the
100.Fl a
101flag is specified, or multiple flags are specified, all
102output is written on a single line, separated by spaces.
103.Pp
104The
105.Fl K
106and
107.Fl U
108flags are intended to be used for fine grain differentiation of incremental
109.Fx
110development and user visible changes.
111Note that when both of these two options are specified, regardless of their
112order, the kernel version would be printed first, followed by the user
113environment version.
114.Sh ENVIRONMENT
115An environment variable composed of the string
116.Ev UNAME_
117followed by any flag to the
118.Nm
119utility (except for
120.Fl a )
121will allow the corresponding data to be set to the contents
122of the environment variable.
123See
124.Xr uname 3
125for more information.
126.Sh EXIT STATUS
127.Ex -std
128.Sh EXAMPLES
129The hardware platform
130.Pq Fl m
131can be different from the machine's processor architecture
132.Pq Fl p ,
133e.g., on 64-bit PowerPC,
134.Fl m
135would return
136.Va powerpc
137and
138.Fl p
139would return
140.Va powerpc64 .
141.Sh SEE ALSO
142.Xr freebsd-version 1 ,
143.Xr feature_present 3 ,
144.Xr getosreldate 3 ,
145.Xr sysctl 3 ,
146.Xr uname 3 ,
147.Xr sysctl 8
148.Sh STANDARDS
149The
150.Nm
151command is expected to conform to the
152.St -p1003.2
153specification.
154.Sh HISTORY
155The
156.Nm
157command appeared in PWB UNIX 1.0, however
158.Bx 4.4
159was the first Berkeley release with the
160.Nm
161command.
162.Pp
163The
164.Fl K
165and
166.Fl U
167extension flags appeared in
168.Fx 10.0 .
169The
170.Fl b
171extension flag appeared in
172.Fx 13.0 .
173