]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - bin/kenv/kenv.1
Add UPDATING entries and bump version.
[FreeBSD/FreeBSD.git] / bin / kenv / kenv.1
1 .\"-
2 .\" Copyright (c) 2000  Peter Wemm <peter@FreeBSD.org>
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 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD$
26 .\"
27 .Dd August 26, 2021
28 .Dt KENV 1
29 .Os
30 .Sh NAME
31 .Nm kenv
32 .Nd list or modify the kernel environment
33 .Sh SYNOPSIS
34 .Nm
35 .Op Fl l | s
36 .Op Fl hNq
37 .Nm
38 .Op Fl qv
39 .Ar variable Ns Op = Ns Ar value
40 .Nm
41 .Op Fl q
42 .Fl u
43 .Ar variable
44 .Sh DESCRIPTION
45 The
46 .Nm
47 utility will list all variables in the kernel environment if
48 invoked without arguments.
49 .Pp
50 If the
51 .Fl l
52 option is specified, then the static environment provided by
53 .Xr loader 8
54 will be listed instead.
55 Similarly, the
56 .Fl s
57 option will list the static environment defined by the kernel config.
58 Both of the
59 .Fl l
60 and
61 .Fl s
62 options are dependent on the kernel being configured to preserve early kernel
63 environments.
64 The default kernel configuration does not preserve these environments.
65 .Pp
66 If the
67 .Fl h
68 option is specified, it will limit the report to kernel probe hints.
69 If an optional
70 .Ar variable
71 name is specified,
72 .Nm
73 will only report that value.
74 If the
75 .Fl N
76 option is specified,
77 .Nm
78 will only display variable names and not their values.
79 If the
80 .Fl u
81 option is specified,
82 .Nm
83 will delete the given environment variable.
84 If the environment variable is followed by an optional
85 .Ar value ,
86 .Nm
87 will set the environment variable to this value.
88 .Pp
89 If the
90 .Fl q
91 option is set, warnings normally printed as a result of being unable to
92 perform the requested operation will be suppressed.
93 .Pp
94 If the
95 .Fl v
96 option is set, the variable name will be printed out for the
97 environment variable in addition to the value when
98 .Nm
99 is executed with a variable name.
100 .Pp
101 Variables can be added to the kernel environment using the
102 .Pa /boot/loader.conf
103 file, or also statically compiled into the kernel using the statement
104 .Pp
105 .Dl Ic env Ar filename
106 .Pp
107 in the kernel config file.
108 The file can contain lines of the form
109 .Pp
110 .Dl name = "value"  # this is a comment
111 .Pp
112 where whitespace around
113 .Sq name
114 and
115 .Sq = ,
116 and everything after a
117 .Sq #
118 character, are ignored.
119 Almost any printable character except
120 .Sq =
121 is acceptable as part of a name.
122 Quotes are optional and necessary only if the value contains whitespace.
123 .Sh SEE ALSO
124 .Xr kenv 2 ,
125 .Xr config 5 ,
126 .Xr loader.conf 5 ,
127 .Xr loader 8
128 .Sh HISTORY
129 The
130 .Nm
131 utility appeared in
132 .Fx 4.1.1 .