Next round of fixing all kinds of spelling mistakes.
[games.git] / usr.bin / xinstall / install.1
1 .\" Copyright (c) 1987, 1990, 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. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"     This product includes software developed by the University of
15 .\"     California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     From: @(#)install.1     8.1 (Berkeley) 6/6/93
33 .\" $FreeBSD: src/usr.bin/xinstall/install.1,v 1.16.2.9 2002/07/01 21:01:23 des Exp $
34 .\" $DragonFly: src/usr.bin/xinstall/install.1,v 1.6 2007/05/17 08:19:02 swildner Exp $
35 .\"
36 .Dd May 7, 2001
37 .Dt INSTALL 1
38 .Os
39 .Sh NAME
40 .Nm install
41 .Nd install binaries
42 .Sh SYNOPSIS
43 .Nm
44 .Op Fl bCclMpSsv
45 .Op Fl L Ar etcdir
46 .Op Fl B Ar suffix
47 .Op Fl f Ar flags
48 .Op Fl g Ar group
49 .Op Fl m Ar mode
50 .Op Fl o Ar owner
51 .Ar file1 file2
52 .Nm
53 .Op Fl bCclMpSsv
54 .Op Fl L Ar etcdir
55 .Op Fl B Ar suffix
56 .Op Fl f Ar flags
57 .Op Fl g Ar group
58 .Op Fl m Ar mode
59 .Op Fl o Ar owner
60 .Ar file1 ... fileN directory
61 .Nm
62 .Fl d
63 .Op Fl vl
64 .Op Fl L Ar etcdir
65 .Op Fl g Ar group
66 .Op Fl m Ar mode
67 .Op Fl o Ar owner
68 .Ar directory ...
69 .Sh DESCRIPTION
70 The file(s) are copied
71 to the target file or directory.
72 If the destination is a directory, then the
73 .Ar file
74 is copied into
75 .Ar directory
76 with its original filename.
77 If the target file already exists, it is
78 either renamed to
79 .Ar file Ns Pa .old
80 if the
81 .Fl b
82 option is given
83 or overwritten
84 if permissions allow.
85 An alternate backup suffix may be specified via the
86 .Fl B
87 option's argument.
88 .Pp
89 The options are as follows:
90 .Bl -tag -width indent
91 .It Fl b
92 Back up any existing files before overwriting them by renaming
93 them to
94 .Ar file Ns Pa .old .
95 See
96 .Fl B
97 for specifying a different backup suffix.
98 .It Fl L Ar etcdir
99 Specify the location of the /etc directory containing the group and password
100 files.  The default is "/etc".  If an alternative directory is specified
101 group and username lookups will be made from the alternative group and
102 password files rather than the system group and password files.
103 .It Fl B Ar suffix
104 Use
105 .Ar suffix
106 as the backup suffix if
107 .Fl b
108 is given.
109 .It Fl C
110 Copy the file.
111 If the target file already exists and the files are the same,
112 then don't change the modification time of the target.
113 .It Fl c
114 Copy the file.
115 This is actually the default.
116 The
117 .Fl c
118 option is only included for backwards compatibility.
119 .It Fl d
120 Create directories.
121 Missing parent directories are created as required.
122 .It Fl f
123 Specify the target's file flags; see
124 .Xr chflags 1
125 for a list of possible flags and their meanings.
126 .It Fl g
127 Specify a group.
128 A numeric GID is allowed.
129 .It Fl l
130 When the
131 .Fl L
132 option is specified and the owner or group cannot be found, fallback to
133 system files.
134 .It Fl M
135 Disable all use of
136 .Xr mmap 2 .
137 .It Fl m
138 Specify an alternate mode.
139 The default mode is set to rwxr-xr-x (0755).
140 The specified mode may be either an octal or symbolic value; see
141 .Xr chmod 1
142 for a description of possible mode values.
143 .It Fl o
144 Specify an owner.
145 A numeric UID is allowed.
146 .It Fl p
147 Preserve the modification time.
148 Copy the file, as if the
149 .Fl C
150 (compare and copy) option is specified,
151 except if the target file doesn't already exist or is different,
152 then preserve the modification time of the file.
153 .It Fl S
154 Safe copy.
155 Normally,
156 .Nm
157 unlinks an existing target before installing the new file.
158 With the
159 .Fl S
160 flag a temporary file is used and then renamed to be
161 the target.
162 The reason this is safer is that if the copy or
163 rename fails, the existing target is left untouched.
164 .It Fl s
165 .Nm
166 exec's the command
167 .Xr strip 1
168 to strip binaries so that
169 .Nm
170 can be portable over a large
171 number of systems and binary types.
172 .It Fl v
173 Cause
174 .Nm
175 to be verbose,
176 showing files as they are installed or backed up.
177 .El
178 .Pp
179 By default,
180 .Nm
181 preserves all file flags, with the exception of the
182 .Dq nodump
183 flag.
184 .Pp
185 The
186 .Nm
187 utility attempts to prevent moving a file onto itself.
188 .Pp
189 Installing
190 .Pa /dev/null
191 creates an empty file.
192 .Sh FILES
193 .Bl -tag -width INS@XXXX -compact
194 .It Pa INS@XXXX
195 If either
196 .Fl S
197 option is specified, or the
198 .Fl C
199 or
200 .Fl p
201 option is used in conjunction with the
202 .Fl s
203 option, temporary files named
204 .Pa INS@XXXX ,
205 where
206 .Pa XXXX
207 is decided by
208 .Xr mkstemp 3 ,
209 are created in the target directory.
210 .El
211 .Sh DIAGNOSTICS
212 .Ex -std
213 .Sh COMPATIBILITY
214 Historically
215 .Nm
216 moved files by default.
217 The default was changed to copy in
218 .Fx 4.4 .
219 .Sh SEE ALSO
220 .Xr chflags 1 ,
221 .Xr chgrp 1 ,
222 .Xr chmod 1 ,
223 .Xr cp 1 ,
224 .Xr mv 1 ,
225 .Xr strip 1 ,
226 .Xr mmap 2 ,
227 .Xr chown 8
228 .Sh HISTORY
229 The
230 .Nm
231 utility appeared in
232 .Bx 4.2 .
233 .Sh BUGS
234 Temporary files may be left in the target directory if
235 .Nm
236 exits abnormally.
237 .Pp
238 File flags cannot be set by
239 .Xr fchflags 2
240 over a NFS filesystem.  Other filesystems do not have a concept of flags.
241 The
242 .Nm
243 utility will only warn when flags could not be set on a filesystem
244 that does not support them.
245 .Pp
246 The
247 .Nm
248 utility with
249 .Fl v
250 falsely says a file is copied when
251 .Fl C
252 snaps hard links.