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.\" $Id$ 34.\" 35.Dd September 22, 1996 36.Dt INSTALL 1 37.Os BSD 4.2 38.Sh NAME 39.Nm install 40.Nd install binaries 41.Sh SYNOPSIS 42.Nm install 43.Op Fl CcDps 44.Op Fl f Ar flags 45.Op Fl g Ar group 46.Op Fl m Ar mode 47.Op Fl o Ar owner 48.Ar file1 file2 49.Nm install 50.Op Fl CcDps 51.Op Fl f Ar flags 52.Op Fl g Ar group 53.Op Fl m Ar mode 54.Op Fl o Ar owner 55.Ar file1 56\&... 57.Ar fileN directory 58.Nm install 59.Fl d 60.Op Fl g Ar group 61.Op Fl m Ar mode 62.Op Fl o Ar owner 63.Ar directory 64\&... 65.Sh DESCRIPTION 66The file(s) are moved (or copied if the 67.Fl c 68option is specified) to the target file or directory. 69If the destination is a directory, then the 70.Ar file 71is moved into 72.Ar directory 73with its original filename. 74If the target file already exists, it is overwritten if permissions 75allow. 76.Pp 77.Bl -tag -width Ds 78.It Fl C 79Copy the file, as if the 80.Fl c 81option is specified, 82except if the target file already exists and the files are the same, 83then don't change the modification time of the target. 84.It Fl c 85Copy the file. 86This flag turns off the default behavior of 87.Nm install 88where it deletes the original file after creating the target. 89.It Fl D 90Print debugging information. 91If 92.Fl D 93is specified one or more times, 94then print the renaming steps for 95.Fl C . 96If 97.Fl D 98is specified two or more times, 99then warn about files that aren't installed with 100.Fl C . 101.It Fl d 102Create directories. 103Missing parent directories are created as required. 104.It Fl f 105Specify the target's file flags. 106(See 107.Xr chflags 1 108for a list of possible flags and their meanings.) 109.It Fl g 110Specify a group. A numeric GID is allowed. 111.It Fl m 112Specify an alternate mode. 113The default mode is set to rwxr-xr-x (0755). 114The specified mode may be either an octal or symbolic value; see 115.Xr chmod 1 116for a description of possible mode values. 117.It Fl o 118Specify an owner. A numeric UID is allowed. 119.It Fl p 120Preserve the modification time. 121Copy the file, as if the 122.Fl C 123(Compare and copy) option is specified, 124except if the target file doesn't already exist or is different, 125then preserve the modification time of the file. 126.It Fl s 127.Nm Install 128exec's the command 129.Xr strip 1 130to strip binaries so that install can be portable over a large 131number of systems and binary types. 132.El 133.Pp 134By default, 135.Nm install 136preserves all file flags, with the exception of the ``nodump'' flag. 137.Pp 138The 139.Nm install 140utility attempts to prevent moving a file onto itself. 141.Pp 142Installing 143.Pa /dev/null 144creates an empty file. 145.Pp 146Upon successful completion a value of 0 is returned. 147Otherwise, a value of 1 is returned. 148.Sh FILES 149.Bl -tag -width INS@XXXX -compact 150.It Pa INS@XXXX 151If the 152.Fl C 153or 154.Fl p 155option is used, then temporary files named INS@XXXX, 156where XXXX is decided by 157.Xr mkstemp 3 , 158are created in the target directory. 159.Sh SEE ALSO 160.Xr chflags 1 , 161.Xr chgrp 1 , 162.Xr chmod 1 , 163.Xr cp 1 , 164.Xr mv 1 , 165.Xr strip 1 , 166.Xr chown 8 167.Sh HISTORY 168The 169.Nm install 170utility appeared in 171.Bx 4.2 . 172.Sh BUGS 173Temporary files may be left in the target directory if 174.Nm install 175exits abnormally. 176