xref: /openbsd-src/usr.bin/uname/uname.1 (revision 70f0ba7cce33ce9915fa0abcdc574065c9a7febb)
1.\"	$OpenBSD: uname.1,v 1.20 2024/06/03 15:55:52 florian Exp $
2.\"
3.\" Copyright (c) 1990 The Regents of the University of California.
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors
15.\"    may be used to endorse or promote products derived from this software
16.\"    without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.\"     from: @(#)du.1	6.13 (Berkeley) 6/20/91
31.\"
32.Dd $Mdocdate: June 3 2024 $
33.Dt UNAME 1
34.Os
35.Sh NAME
36.Nm uname
37.Nd print operating system name
38.Sh SYNOPSIS
39.Nm uname
40.Op Fl amnprsv
41.Sh DESCRIPTION
42The
43.Nm uname
44utility writes strings representing one or more system characteristics
45to the standard output.
46The formats and meanings of all these strings vary among operating systems.
47.Pp
48The options are as follows:
49.Bl -tag -width Ds
50.It Fl a
51Behave as though all of the options
52.Fl mnrsv
53were specified.
54.It Fl m
55Print the name of the hardware type.
56On
57.Ox ,
58this is the kernel architecture as returned by
59.Xr machine 1 .
60.It Fl n
61Print the network name of this machine.
62On
63.Ox ,
64the same name can be printed with
65.Xr hostname 1 .
66.It Fl p
67Print the application architecture as returned by
68.Xr arch 1
69.Fl s .
70.It Fl r
71Print the operating system release.
72On
73.Ox ,
74the format is
75.Sm off
76.Ar digit . digit .
77.Sm on
78.It Fl s
79Print the operating system name.
80On
81.Ox ,
82this is always
83.Dq Ox .
84.It Fl v
85Print the operating system version.
86On
87.Ox ,
88the format is
89.Ar SYSTEMNAME Ns # Ns Ar buildnumber
90with the
91.Ar SYSTEMNAME
92mentioned in
93.Xr config 8 .
94.El
95.Pp
96If no options are specified,
97.Nm uname
98prints the operating system name as if the
99.Fl s
100option had been specified.
101.Pp
102If
103.Fl a
104or more than one option is specified,
105.Ox
106prints the selected fields separated by single space characters
107in the following order: operating system name, network name,
108release, version, kernel architecture, application architecture.
109.Sh EXIT STATUS
110.Ex -std uname
111.Sh SEE ALSO
112.Xr hostname 1 ,
113.Xr machine 1 ,
114.Xr uname 3
115.Sh STANDARDS
116The
117.Nm
118utility is compliant with the
119.St -p1003.1-2008
120specification.
121.Pp
122The flag
123.Op Fl p
124is an extension to that specification.
125.Sh HISTORY
126The
127.Nm
128command first appeared in PWB/UNIX 1.0
129and was reimplemented for
130.Bx 4.4 .
131