install

Install binaries

install [-bCcpSsUv] [-B suffix] [-D destdir] [-f flags] [-g group] [-h hash]
[-l linkflags] [-M metallog] [-m mode] [-o owner] [-T tags] file1 file2

install [-bCcpSsUv] [-B suffix] [-D destdir] [-f flags] [-g group] [-h hash]
[-l linkflags] [-M metallog] [-m mode] [-o owner] [-T tags] file1 ... fileN directory

install -d [-Uv] [-D destdir] [-g group] [-h hash] [-M metallog] [-m mode] [-o owner] [-T tags] directory

Files are copied (or linked with -l ) to the target file or directory.
If the destination is a directory the file is copied into directory with its original filename.
If the target file exists, it is either renamed to file.old with -b or overwritten if permissions allow.
An alternate backup suffix may be specified using -B argument.

-cCopy the file. default.
-CCopy the file.
If the target file exists and the files are the same, do not change the modification time of the target.
If the target's file flags and mode do not need not to be changed, the target's change time is not updated.
-S Safe copy. Normally unlinks an existing target before installing the new file.
With -S a temporary file is written and then renamed to be the target. If the copy or rename fails, the existing target is retained.
-p Copy the file and Preserve the access and modification times as if -C (compare and copy) is specified, except if the target file does not already exist or is different, then preserve the access and modification times of the source file.
-l a|r|h|s|m Do not copy the file make a link to the source. a (absolute), r (relative), h (hard), s (symbolic), m (mixed).
Absolute and relative have effect only for symbolic links.
Mixed links are hard links for files on the same filesystem, symbolic otherwise.
-b Back up files before overwriting them by renaming them to file.old.
-B suffix Use suffix as the backup suffix .
-D destdir The destdir (top of the file hierarchy) where items are installed.
-d Create directories. Missing parent directories are created as required.
-h hash calculate the digest of the files with hash to store in the metalog.
When -d is given no hash is emitted.
Supported digests:
none No hash, the default.
md5 MD5 cryptographic
rmd160 RMD-160 cryptographic
sha1 SHA-1 cryptographic
sha256 256-bits SHA-2 cryptographic
sha512 The 512-bits SHA-2 cryptographic
-v Display files as they are installed or backed up.
-M metalog Write the metadata for with each item installed in an mtree "full path" specification line.
The metadata includes: file name and type, and depending upon other options, owner, group, file flags, modification time, and tags. The leading string of destdir is not included.
-T tags Specify the mtree tags to write out for the file when using -M metalog.
-f flags Set the target's file flags see chflags
-o owner A string or numeric owner.
-g group A string or numeric group
-m mode octal or symbolic mode. The default is rwxr-xr-x (0755).
-U Running unprivileged and no change s made to owner, group, or file flags. of the destination. Details can be stored with -M metalog.
-s Strip files using strip or the program specified by $STRIPBIN.

By default, file flags are preserves except nodump .

Installing /dev/null creates an empty file.

ENVIRONMENTI

$STRIPBIN specifies the program to run with -s.
$DONTSTRIP presents causes -s to be ignored .

FILES

INS@xxxxx When using -S or -s with -C or -p, temporary files defined by mkstemp are created in the target directory.

EXIT STATUS

The install utility exits 0 on success.

COMPATIBILITY

The default is to copy files.

SEE ALSO

chflags(1), chgrp(1), chmod(1), cp(1), mv(1), strip(1), mmap(2), getgrnam(3), getpwnam(3), chown(8) BUGS Temporary files may be left in the target directory if install exits abnormally.

File flags cannot be set by fchflags(2) over a NFS file system. Other file systems do not have flags.
The install will warn when flags could not be set.

-v falsely says a file is copied when -C snaps hard links.