]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/xinstall/install.1
This commit was generated by cvs2svn to compensate for changes in r77422,
[FreeBSD/FreeBSD.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$
34 .\"
35 .Dd May 7, 2001
36 .Dt INSTALL 1
37 .Os
38 .Sh NAME
39 .Nm install
40 .Nd install binaries
41 .Sh SYNOPSIS
42 .Nm
43 .Op Fl bCcMpSsv
44 .Op Fl B Ar suffix
45 .Op Fl f Ar flags
46 .Op Fl g Ar group
47 .Op Fl m Ar mode
48 .Op Fl o Ar owner
49 .Ar file1 file2
50 .Nm
51 .Op Fl bCcMpSsv
52 .Op Fl B Ar suffix
53 .Op Fl f Ar flags
54 .Op Fl g Ar group
55 .Op Fl m Ar mode
56 .Op Fl o Ar owner
57 .Ar file1
58 \&...
59 .Ar fileN directory
60 .Nm
61 .Fl d
62 .Op Fl v
63 .Op Fl g Ar group
64 .Op Fl m Ar mode
65 .Op Fl o Ar owner
66 .Ar directory
67 \&...
68 .Sh DESCRIPTION
69 The file(s) are moved (or copied if the
70 .Fl c
71 option is specified) to the target file or directory.
72 If the destination is a directory, then the
73 .Ar file
74 is moved 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 B Ar suffix
99 Use
100 .Ar suffix
101 as the backup suffix if
102 .Fl b
103 is given.
104 .It Fl C
105 Copy the file.
106 If the target file already exists and the files are the same,
107 then don't change the modification time of the target.
108 .It Fl c
109 Copy the file.
110 This is actually the default.
111 The
112 .Fl c
113 option is only included for backwards compatibility.
114 .It Fl d
115 Create directories.
116 Missing parent directories are created as required.
117 .It Fl f
118 Specify the target's file flags; see
119 .Xr chflags 1
120 for a list of possible flags and their meanings.
121 .It Fl g
122 Specify a group.
123 A numeric GID is allowed.
124 .It Fl M
125 Disable all use of
126 .Xr mmap 2 .
127 .It Fl m
128 Specify an alternate mode.
129 The default mode is set to rwxr-xr-x (0755).
130 The specified mode may be either an octal or symbolic value; see
131 .Xr chmod 1
132 for a description of possible mode values.
133 .It Fl o
134 Specify an owner.
135 A numeric UID is allowed.
136 .It Fl p
137 Preserve the modification time.
138 Copy the file, as if the
139 .Fl C
140 (compare and copy) option is specified,
141 except if the target file doesn't already exist or is different,
142 then preserve the modification time of the file.
143 .It Fl S
144 Safe copy.
145 Normally,
146 .Nm
147 unlinks an existing target before installing the new file.
148 With the
149 .Fl S
150 flag a temporary file is used and then renamed to be
151 the target.
152 The reason this is safer is that if the copy or
153 rename fails, the existing target is left untouched.
154 .It Fl s
155 .Nm
156 exec's the command
157 .Xr strip 1
158 to strip binaries so that
159 .Nm
160 can be portable over a large
161 number of systems and binary types.
162 .It Fl v
163 Causes
164 .Nm
165 to show when
166 .Fl C
167 actually installs something.
168 .El
169 .Pp
170 By default,
171 .Nm
172 preserves all file flags, with the exception of the
173 .Dq nodump
174 flag.
175 .Pp
176 The
177 .Nm
178 utility attempts to prevent moving a file onto itself.
179 .Pp
180 Installing
181 .Pa /dev/null
182 creates an empty file.
183 .Sh DIAGNOSTICS
184 The
185 .Nm
186 utility exits 0 on success, and 1 otherwise.
187 .Sh FILES
188 .Bl -tag -width INS@XXXX -compact
189 .It Pa INS@XXXX
190 If either
191 .Fl S
192 option is specified, or the
193 .Fl C
194 or
195 .Fl p
196 option is used in conjuction with the
197 .Fl s
198 option, temporary files named
199 .Pa INS@XXXX ,
200 where
201 .Pa XXXX
202 is decided by
203 .Xr mkstemp 3 ,
204 are created in the target directory.
205 .El
206 .Sh SEE ALSO
207 .Xr chflags 1 ,
208 .Xr chgrp 1 ,
209 .Xr chmod 1 ,
210 .Xr cp 1 ,
211 .Xr mv 1 ,
212 .Xr strip 1 ,
213 .Xr mmap 2 ,
214 .Xr chown 8
215 .Sh HISTORY
216 The
217 .Nm
218 utility appeared in
219 .Bx 4.2 .
220 .Sh BUGS
221 Temporary files may be left in the target directory if
222 .Nm
223 exits abnormally.
224 .Pp
225 File flags cannot be set by
226 .Xr fchflags 2
227 over a NFS file system.  Other file systems do not have a concept of flags.
228 .Nm
229 will only warn when flags could not be set on a file system
230 that does not support them.
231 .Pp
232 .Nm
233 with
234 .Fl v
235 falsely says a file is copied when
236 .Fl C
237 snaps hard links.