293 useradd/del/mod should be ZFS-aware
[illumos-gate.git] / usr / src / man / man1m / install.1m
blobf7494d2adadf36a757ea8e450d59645a9092a736
1 '\" te
2 .\"  Copyright 1989 AT&T Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH INSTALL 1M "Nov 3, 2005"
7 .SH NAME
8 install \- install commands
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fB/usr/sbin/install\fR \fB-c\fR \fIdira\fR [\fB-m\fR \fImode\fR] [\fB-u\fR \fIuser\fR] [\fB-g\fR \fIgroup\fR]
13      [\fB-o\fR] [\fB-s\fR] \fIfile\fR
14 .fi
16 .LP
17 .nf
18 \fB/usr/sbin/install\fR \fB-f\fR \fIdirb\fR [\fB-m\fR \fImode\fR] [\fB-u\fR \fIuser\fR] [\fB-g\fR \fIgroup\fR]
19      [\fB-o\fR] [\fB-s\fR] \fIfile\fR
20 .fi
22 .LP
23 .nf
24 \fB/usr/sbin/install\fR \fB-n\fR \fIdirc\fR [\fB-m\fR \fImode\fR] [\fB-u\fR \fIuser\fR] [\fB-g\fR \fIgroup\fR]
25      [\fB-o\fR] [\fB-s\fR] \fIfile\fR
26 .fi
28 .LP
29 .nf
30 \fB/usr/sbin/install\fR \fB-d\fR | \fB-i\fR [\fB-m\fR \fImode\fR] [\fB-u\fR \fIuser\fR] [\fB-g\fR \fIgroup\fR]
31      [\fB-o\fR] [\fB-s\fR] \fIdirx\fR...
32 .fi
34 .LP
35 .nf
36 \fB/usr/sbin/install\fR [\fB-m\fR \fImode\fR] [\fB-u\fR \fIuser\fR] [\fB-g\fR \fIgroup\fR] [\fB-o\fR] [\fB-s\fR] \fIfile\fR
37      [\fIdirx\fR]...
38 .fi
40 .SH DESCRIPTION
41 .sp
42 .LP
43 \fBinstall\fR is most commonly used in ``makefiles'' (see \fBmake\fR(1S)) to
44 install a \fBfile\fR in specific locations, or to create directories within a
45 file system. Each \fBfile\fR is installed by copying it into the appropriate
46 directory.
47 .sp
48 .LP
49 \fBinstall\fR uses no special privileges to copy files from one place to
50 another. The implications of this are:
51 .RS +4
52 .TP
53 .ie t \(bu
54 .el o
55 You must have permission to read the files to be installed.
56 .RE
57 .RS +4
58 .TP
59 .ie t \(bu
60 .el o
61 You must have permission to copy into the destination directory.
62 .RE
63 .RS +4
64 .TP
65 .ie t \(bu
66 .el o
67 You must have permission to change the modes on the final copy of the file if
68 you want to use the \fB-m\fR option.
69 .RE
70 .RS +4
71 .TP
72 .ie t \(bu
73 .el o
74 You must be super-user if you want to specify the ownership of the installed
75 file with the \fB-u\fR or \fB-g\fR options. If you are not the super-user, the
76 installed file is owned by you, regardless of who owns the original.
77 .RE
78 .sp
79 .LP
80 Note that if the \fBROOT\fR environment variable is set, each of the default
81 directory paths are prefixed by its value (for example, \fB$ROOT/bin\fR and so
82 on).
83 .sp
84 .LP
85 \fBinstall\fR prints messages telling the user exactly what files it is
86 replacing or creating and where they are going.
87 .sp
88 .LP
89 If no options or directories (\fIdirx\fR .\|.\|.) are given, \fBinstall\fR
90 searches a set of default directories ( \fB/bin\fR, \fB/usr/bin\fR, \fB/etc\fR,
91 \fB/lib\fR, and \fB/usr/lib\fR, in that order) for a file with the same name as
92 \fBfile\fR. When the first occurrence is found, \fBinstall\fR issues a message
93 saying that it is overwriting that file with \fBfile\fR, and proceeds to do so.
94 If the file is not found, the program states this and exits.
95 .sp
96 .LP
97 If one or more directories (\fIdirx\fR .\|.\|.) are specified after \fBfile\fR,
98 those directories are searched before the default directories.
99 .sp
101 This version of \fBinstall\fR (\fB/usr/sbin/install\fR) is not compatible with
102 the \fBinstall\fR binaries in many versions of Unix other than Solaris. For a
103 higher degree of compatibility with other Unix versions, use
104 \fB/usr/ucb/install\fR, which is described in the \fBinstall\fR(1B) man page.
105 .SH OPTIONS
108 The following options are supported:
110 .ne 2
112 \fB\fB-c\fR \fIdira\fR\fR
114 .RS 12n
115 Install \fBfile\fR in the directory specified by \fIdira\fR, if \fBfile\fR does
116 not yet exist. If it is found, \fBinstall\fR issues a message saying that the
117 file already exists, and exits without overwriting it.
121 .ne 2
123 \fB\fB-f\fR \fIdirb\fR\fR
125 .RS 12n
126 Force \fBfile\fR to be installed in given directory, even if the file already
127 exists. If the file being installed does not already exist, the mode and owner
128 of the new file is set to \fB755\fR and \fBbin\fR \fB,\fR respectively. If the
129 file already exists, the mode and owner is that of the already existing file.
133 .ne 2
135 \fB\fB-n\fR \fIdirc\fR\fR
137 .RS 12n
138 If \fBfile\fR is not found in any of the searched directories, it is put in the
139 directory specified in \fIdirc\fR. The mode and owner of the new file is set to
140 \fB755\fR and \fBbin\fR, respectively.
144 .ne 2
146 \fB\fB-d\fR\fR
148 .RS 12n
149 Create a directory. Missing parent directories are created as required as in
150 \fBmkdir \fR\fB-p\fR. If the directory already exists, the owner, group and
151 mode is set to the values given on the command line.
155 .ne 2
157 \fB\fB-i\fR\fR
159 .RS 12n
160 Ignore default directory list, searching only through the given directories
161 (\fIdirx\fR .\|.\|.).
165 .ne 2
167 \fB\fB-m\fR \fImode\fR\fR
169 .RS 12n
170 The mode of the new file is set to \fImode\fR. Set to \fB0755\fR by default.
174 .ne 2
176 \fB\fB-u\fR \fIuser\fR\fR
178 .RS 12n
179 The owner of the new file is set to \fIuser\fR. Only available to the
180 super-user. Set to \fBbin\fR by default.
184 .ne 2
186 \fB\fB-g\fR \fIgroup\fR\fR
188 .RS 12n
189 The group id of the new file is set to \fIgroup\fR. Only available to the
190 super-user. Set to \fBbin\fR by default.
194 .ne 2
196 \fB\fB-o\fR\fR
198 .RS 12n
199 If \fBfile\fR is found, save the ``found'' file by copying it to
200 \fBOLD\fR\fBfile\fR in the directory in which it was found. This option is
201 useful when installing a frequently used file such as \fB/bin/sh\fR or
202 \fB/lib/saf/ttymon\fR, where the existing file cannot be removed.
206 .ne 2
208 \fB\fB-s\fR\fR
210 .RS 12n
211 Suppress printing of messages other than error messages.
214 .SH USAGE
217 See \fBlargefile\fR(5) for the description of the behavior of \fBinstall\fR
218 when encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
219 .SH SEE ALSO
222 \fBchgrp\fR(1), \fBchmod\fR(1), \fBchown\fR(1), \fBcp\fR(1), \fBinstall\fR(1B),
223 \fBmake\fR(1S), \fBmkdir\fR(1), \fBattributes\fR(5), \fBlargefile\fR(5)