xref: /freebsd/usr.bin/xinstall/install.1 (revision 8e6b01171e30297084bb0b4457c4183c2746aacc)
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 October 9, 1995
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 cs
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.Sh DESCRIPTION
59The file(s) are moved (or copied if the
60.Fl c
61option is specified) to the target file or directory.
62If the destination is a directory, then the
63.Ar file
64is moved into
65.Ar directory
66with its original filename.
67If the target file already exists, it is overwritten if permissions
68allow.
69.Pp
70.Bl -tag -width Ds
71.It Fl C .
72Copy the file, as if the
73.Fl c
74option is specifed,
75except if the target file already exists and the files are the same,
76then don't change the modification time of the target
77.It Fl c
78Copy the file.
79This flag turns off the default behavior of
80.Nm install
81where it deletes the original file after creating the target.
82.It Fl d
83Print debugging information.
84If
85.Fl d
86is specified one or more times,
87then print the renaming steps for
88.Fl C .
89If
90.Fl d
91is specified two or more times,
92then warn about files that aren't installed with
93.Fl C .
94.It Fl f
95Specify the target's file flags.
96(See
97.Xr chflags 1
98for a list of possible flags and their meanings.)
99.It Fl g
100Specify a group.
101.It Fl m
102Specify an alternate mode.
103The default mode is set to rwxr-xr-x (0755).
104The specified mode may be either an octal or symbolic value; see
105.Xr chmod  1
106for a description of possible mode values.
107.It Fl o
108Specify an owner.
109.It Fl p
110Preserve the modification time.
111Copy the file, as if the
112.Fl C
113(Compare and copy) option is specifed,
114except if the target file doesn't already exist or is different,
115then preserve the modification time of the file.
116.It Fl s
117.Nm Install
118exec's the command
119.Xr strip  1
120to strip binaries so that install can be portable over a large
121number of systems and binary types.
122.El
123.Pp
124By default,
125.Nm install
126preserves all file flags, with the exception of the ``nodump'' flag.
127.Pp
128The
129.Nm install
130utility attempts to prevent moving a file onto itself.
131.Pp
132Installing
133.Pa /dev/null
134creates an empty file.
135.Pp
136Upon successful completion a value of 0 is returned.
137Otherwise, a value of 1 is returned.
138.Sh FILES
139.Bl -tag -width INS@XXXX -compact
140.It Pa INS@XXXX
141If the
142.Fl C
143or
144.Fl p
145option is used, then temporary files named INS@XXXX,
146where XXXX is decided by
147.Xr mkstemp 3 ,
148are created in the target directory.
149.Sh SEE ALSO
150.Xr chflags 1 ,
151.Xr chgrp 1 ,
152.Xr chmod 1 ,
153.Xr cp 1 ,
154.Xr mv 1 ,
155.Xr strip 1 ,
156.Xr chown 8
157.Sh HISTORY
158The
159.Nm install
160utility appeared in
161.Bx 4.2 .
162.Sh BUGS
163Temporary files may be left in the target directory if
164.Nm install
165exits abnormally.
166