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 70The file(s) are copied 71to the target file or directory. 72If the destination is a directory, then the 73.Ar file 74is copied into 75.Ar directory 76with its original filename. 77If the target file already exists, it is 78either renamed to 79.Ar file Ns Pa .old 80if the 81.Fl b 82option is given 83or overwritten 84if permissions allow. 85An alternate backup suffix may be specified via the 86.Fl B 87option's argument. 88.Pp 89The options are as follows: 90.Bl -tag -width indent 91.It Fl b 92Back up any existing files before overwriting them by renaming 93them to 94.Ar file Ns Pa .old . 95See 96.Fl B 97for specifying a different backup suffix. 98.It Fl L Ar etcdir 99Specify the location of the /etc directory containing the group and password 100files. The default is "/etc". If an alternative directory is specified 101group and username lookups will be made from the alternative group and 102password files rather than the system group and password files. 103.It Fl B Ar suffix 104Use 105.Ar suffix 106as the backup suffix if 107.Fl b 108is given. 109.It Fl C 110Copy the file. 111If the target file already exists and the files are the same, 112then don't change the modification time of the target. 113.It Fl c 114Copy the file. 115This is actually the default. 116The 117.Fl c 118option is only included for backwards compatibility. 119.It Fl d 120Create directories. 121Missing parent directories are created as required. 122.It Fl f 123Specify the target's file flags; see 124.Xr chflags 1 125for a list of possible flags and their meanings. 126.It Fl g 127Specify a group. 128A numeric GID is allowed. 129.It Fl l 130When the 131.Fl L 132option is specified and the owner or group cannot be found, fallback to 133system files. 134.It Fl M 135Disable all use of 136.Xr mmap 2 . 137.It Fl m 138Specify an alternate mode. 139The default mode is set to rwxr-xr-x (0755). 140The specified mode may be either an octal or symbolic value; see 141.Xr chmod 1 142for a description of possible mode values. 143.It Fl o 144Specify an owner. 145A numeric UID is allowed. 146.It Fl p 147Preserve the modification time. 148Copy the file, as if the 149.Fl C 150(compare and copy) option is specified, 151except if the target file doesn't already exist or is different, 152then preserve the modification time of the file. 153.It Fl S 154Safe copy. 155Normally, 156.Nm 157unlinks an existing target before installing the new file. 158With the 159.Fl S 160flag a temporary file is used and then renamed to be 161the target. 162The reason this is safer is that if the copy or 163rename fails, the existing target is left untouched. 164.It Fl s 165.Nm 166exec's the command 167.Xr strip 1 168to strip binaries so that 169.Nm 170can be portable over a large 171number of systems and binary types. 172.It Fl v 173Cause 174.Nm 175to be verbose, 176showing files as they are installed or backed up. 177.El 178.Pp 179By default, 180.Nm 181preserves all file flags, with the exception of the 182.Dq nodump 183flag. 184.Pp 185The 186.Nm 187utility attempts to prevent moving a file onto itself. 188.Pp 189Installing 190.Pa /dev/null 191creates an empty file. 192.Sh FILES 193.Bl -tag -width INS@XXXX -compact 194.It Pa INS@XXXX 195If either 196.Fl S 197option is specified, or the 198.Fl C 199or 200.Fl p 201option is used in conjunction with the 202.Fl s 203option, temporary files named 204.Pa INS@XXXX , 205where 206.Pa XXXX 207is decided by 208.Xr mkstemp 3 , 209are created in the target directory. 210.El 211.Sh EXIT STATUS 212.Ex -std 213.Sh COMPATIBILITY 214Historically 215.Nm 216moved files by default. 217The 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 229The 230.Nm 231utility appeared in 232.Bx 4.2 . 233.Sh BUGS 234Temporary files may be left in the target directory if 235.Nm 236exits abnormally. 237.Pp 238File flags cannot be set by 239.Xr fchflags 2 240over a NFS filesystem. Other filesystems do not have a concept of flags. 241The 242.Nm 243utility will only warn when flags could not be set on a filesystem 244that does not support them. 245.Pp 246The 247.Nm 248utility with 249.Fl v 250falsely says a file is copied when 251.Fl C 252snaps hard links. 253