'\" te .\" Copyright 1989 AT&T Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved .\" 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. .\" 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. .\" 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] .TH INSTALL 8 "Feb 17, 2023" .SH NAME install \- install commands .SH SYNOPSIS .nf \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] [\fB-o\fR] [\fB-s\fR] \fIfile\fR .fi .LP .nf \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] [\fB-o\fR] [\fB-s\fR] \fIfile\fR .fi .LP .nf \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] [\fB-o\fR] [\fB-s\fR] \fIfile\fR .fi .LP .nf \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] [\fB-o\fR] [\fB-s\fR] \fIdirx\fR... .fi .LP .nf \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 [\fIdirx\fR]... .fi .SH DESCRIPTION \fBinstall\fR is most commonly used in ``makefiles'' (see \fBmake\fR(1S)) to install a \fBfile\fR in specific locations, or to create directories within a file system. Each \fBfile\fR is installed by copying it into the appropriate directory. .sp .LP \fBinstall\fR uses no special privileges to copy files from one place to another. The implications of this are: .RS +4 .TP .ie t \(bu .el o You must have permission to read the files to be installed. .RE .RS +4 .TP .ie t \(bu .el o You must have permission to copy into the destination directory. .RE .RS +4 .TP .ie t \(bu .el o You must have permission to change the modes on the final copy of the file if you want to use the \fB-m\fR option. .RE .RS +4 .TP .ie t \(bu .el o You must be super-user if you want to specify the ownership of the installed file with the \fB-u\fR or \fB-g\fR options. If you are not the super-user, the installed file is owned by you, regardless of who owns the original. .RE .sp .LP Note that if the \fBROOT\fR environment variable is set, each of the default directory paths are prefixed by its value (for example, \fB$ROOT/bin\fR and so on). .sp .LP \fBinstall\fR prints messages telling the user exactly what files it is replacing or creating and where they are going. .sp .LP If no options or directories (\fIdirx\fR .\|.\|.) are given, \fBinstall\fR searches a set of default directories (\fB/bin\fR, \fB/usr/bin\fR, \fB/etc\fR, \fB/lib\fR, and \fB/usr/lib\fR, in that order) for a file with the same name as \fBfile\fR. When the first occurrence is found, \fBinstall\fR issues a message saying that it is overwriting that file with \fBfile\fR, and proceeds to do so. If the file is not found, the program states this and exits. .sp .LP If one or more directories (\fIdirx\fR .\|.\|.) are specified after \fBfile\fR, those directories are searched before the default directories. .sp .LP This version of \fBinstall\fR (\fB/usr/sbin/install\fR) is not compatible with the \fBinstall\fR binaries in many versions of Unix other than Solaris. For a higher degree of compatibility with other Unix versions, use \fB/usr/ucb/install\fR, which is described in the \fBinstall\fR(1B) man page. .SH OPTIONS The following options are supported: .sp .ne 2 .na \fB\fB-c\fR \fIdira\fR\fR .ad .RS 12n Install \fBfile\fR in the directory specified by \fIdira\fR, if \fBfile\fR does not yet exist. If it is found, \fBinstall\fR issues a message saying that the file already exists, and exits without overwriting it. .RE .sp .ne 2 .na \fB\fB-f\fR \fIdirb\fR\fR .ad .RS 12n Force \fBfile\fR to be installed in given directory, even if the file already exists. If the file being installed does not already exist, the mode and owner of the new file is set to \fB755\fR and \fBbin\fR \fB,\fR respectively. If the file already exists, the mode and owner is that of the already existing file. .RE .sp .ne 2 .na \fB\fB-n\fR \fIdirc\fR\fR .ad .RS 12n If \fBfile\fR is not found in any of the searched directories, it is put in the directory specified in \fIdirc\fR. The mode and owner of the new file is set to \fB755\fR and \fBbin\fR, respectively. .RE .sp .ne 2 .na \fB\fB-d\fR\fR .ad .RS 12n Create a directory. Missing parent directories are created as required as in \fBmkdir \fR\fB-p\fR. If the directory already exists, the owner, group and mode is set to the values given on the command line. .RE .sp .ne 2 .na \fB\fB-i\fR\fR .ad .RS 12n Ignore default directory list, searching only through the given directories (\fIdirx\fR .\|.\|.). .RE .sp .ne 2 .na \fB\fB-m\fR \fImode\fR\fR .ad .RS 12n The mode of the new file is set to \fImode\fR. Set to \fB0755\fR by default. .RE .sp .ne 2 .na \fB\fB-u\fR \fIuser\fR\fR .ad .RS 12n The owner of the new file is set to \fIuser\fR. Only available to the super-user. Set to \fBbin\fR by default. .RE .sp .ne 2 .na \fB\fB-g\fR \fIgroup\fR\fR .ad .RS 12n The group id of the new file is set to \fIgroup\fR. Only available to the super-user. Set to \fBbin\fR by default. .RE .sp .ne 2 .na \fB\fB-o\fR\fR .ad .RS 12n If \fBfile\fR is found, save the ``found'' file by copying it to \fBOLD\fR\fBfile\fR in the directory in which it was found. This option is useful when installing a frequently used file such as \fB/bin/sh\fR or \fB/lib/saf/ttymon\fR, where the existing file cannot be removed. .RE .sp .ne 2 .na \fB\fB-s\fR\fR .ad .RS 12n Suppress printing of messages other than error messages. .RE .SH USAGE See \fBlargefile\fR(7) for the description of the behavior of \fBinstall\fR when encountering files greater than or equal to 2 Gbyte (2^31 bytes). .SH SEE ALSO .BR chgrp (1), .BR chmod (1), .BR chown (1), .BR cp (1), .BR mkdir (1), .BR install (1B), .BR make (1S), .BR attributes (7), .BR largefile (7)