INSTALL(1)INSTALL(1)NAMEinstall - install files in directories
SYNOPSIS
/sbin/install options file ...
BSD/GNU SYNOPSIS
/sbin/install options file ... directory
/sbin/install options file1 file2
/sbin/install options -d directories ...
DESCRIPTION
Install copies regular files generated in a source tree into a target
directory. It can also create directories, links and special files in a
target directory. The target directory's pathname will be prefixed by
the value of the ROOT environment variable. Install is most commonly
invoked from makefiles (see make(1)).
If the RAWIDB environment variable is set, install creates no files in
target directories; instead, it appends records describing the files that
it would have created to the installation database (IDB) named by
$RAWIDB. When generating an IDB, either install must be invoked under a
directory named src, or the SRC environment variable must be set and must
name an ancestor of the current working directory.
Install's options specify how to install, what type of file to create,
and where to install in the target tree. Options are collected from the
INSTOPTS environment variable, then from the command line. If
incompatible options are specified in INSTOPTS and the command line, the
command line options take precedence. Note that single-letter options
cannot be concatenated after a hyphen.
BSD/GNU compatibility (where the target file or directory is the last
argument) is supported in case none of the mandatory arguments (-f, -F,
or -dir) is provided. In this case the -s option means strip.
The options are:
-m mode Set the mode of created files to mode, interpreted as an
octal number. The default mode for regular files and
directories is 755. The default mode for devices and
named pipes is 666. This option is ignored if given with
-ln or -lns.
-u owner Set the owner of created files to owner, which is
interpreted first as a user name, then as a numeric user
ID if it fails to match known user names. If the
superuser invokes install, the default owner is root.
Otherwise the default owner is the effective user ID of
the invoker. This option is ignored if given with -ln.
If $RAWIDB is set, and -lns is used, it is effectively
ignored, because inst(1m) does not support setting the
Page 1
INSTALL(1)INSTALL(1)
owner on symlinks.
-g group Set the group of created files to group, which is
interpreted first as a group name, then as a numeric
group ID if it fails to match known group names. If the
superuser invokes install, the default group is sys.
Otherwise the default group is the effective group ID of
the invoker. This option is ignored if given with -ln.
If $RAWIDB is set, and -lns is used, it is effectively
ignored, because inst(1m) does not support setting the
group on symlinks.
-idb attribute Add an IDB attribute to the records for files which
install would have created in its normal mode. This
option may occur several times among the option
arguments.
-new By default, install creates a regular file with the same
modification time (mtime) as its source. This option
disables mtime preservation, resulting in each regular
file being installed with its mtime set by install's
final write to it.
-o If a target exists, save it in the target directory with
a hard link named OLDfile .
-O If the target exists, try to remove it. If it cannot be
unlinked, save it in the same manner as -o.
-rawidb idbpath Change install's mode from file creation to IDB
generation, so that it appends records to the file named
by idbpath. This option overrides the RAWIDB environment
variable.
-root rootpath Set the string prepended to all absolute pathnames
created by install to rootpath. This option overrides
the ROOT environment variable.
-s Be silent. Older versions of install printed verbose
information by default when installing. Install is now
silent by default, but this option remains for
compatibility.
-t Symbolically link targets to sources when installing
regular files.
-v Be verbose. This option causes install to print a line
telling source and target pathnames for each file
installed.
Page 2
INSTALL(1)INSTALL(1)
Only one of the following options may be specified for a given invocation
of install, to install non-regular files:
-blk maj,min[,off]
Create a block device node with major device number maj
and minor number min. If min has the form
lowmin-highmin, install creates block device nodes for
minor numbers lowmin through highmin, inclusive, forming
each node's name by concatenating file and the minor
device number. If the optional offset is given, it is
added to the minor number (the offset may be negative).
This is primarily useful with the range form in scripts,
such as /dev/MAKEDEV. If the device exists, with the
correct type (block), and correct major and minor number,
it is left as is, and the ownership and permissions are
left unchanged. This also is useful in scripts where you
want to make sure that the device exists, but want to
preserve any local changes in owner and permissions. The
-O and -o options are not supported with this option.
-chr maj,min[,off]
Like -blk, but creates character device nodes.
-c BSD old compatibility mode (ignored)
-dir (or -d for BSD/GNU compatibility)
Create directories named by concatenating $ROOT to the
file arguments. When -dir is given, all the file
arguments are taken as directories; files and directories
may not both be installed with the same command.
-fifo Create named pipes named by the file arguments.
-ln path Create hard links named by the file arguments to the node
named by path. If path is a file, it will be linked to
file. If you want the link to be from a file in the
directory of the -f and -F options you must preceed it by
the same directory string as for those options.
-lns path Create symbolic links named by the file arguments which
point to path. If path is a relative pathname, the
symbolic link will also be relative to the directory of
the -f and -F options.
This option may be used only when installing regular files:
-src path Use path as the source file's pathname when installing a
regular file. This option is useful for renaming a
source file in the target directory.
Page 3
INSTALL(1)INSTALL(1)
One of the following two options must be used unless installing
directories with -dir:
-f dir Install files in the target directory ${ROOT}dir.
-F dir Like -f, but creates any directories in the target
pathname which do not exist.
EXAMPLES
To install several programs, issue:
install-f /etc mount umount
To install a file which has a different name in the target tree, and
which might be executing during installation, use:
install-F /etc -src Install -Oinstall
This invocation creates disk device nodes, along with necessary
directories:
install-F /dev/dsk -m 600 -u root -g sys -blk 4,0-15 ips0d0s
BSD/GNU compatibility example:
install-m 775 -s file1 file2 file3 /usr/gnu/bin
SEE ALSOmake(1).
BSD/GNU COMPATIBILITY NOTES
o GNU long options (e.g. --help) aren't supported.
o If strip is not installed, -s will give a warning (of course).
Page 4