INSTALL(1x) 1x INSTALL(1x)

This manual page is part of Cross-Unix Documentation which is an attempt to provide documentation of similarities and (noteworthy) differencies between Unix-like systems. To be used as an addition to the POSIX standard.

installinstall binairies

install [-bcDsp] [-g group] [-m mode] [-o owner] [source] [destination]

install [-bcsp] [-g group] [-m mode] [-o owner] [-D destdir] [source] [destination]

install copies source to destination, if destination already exists it is removed or renamed if -b is specified before source is copied. If destination is a directory then source is copied into destination with its original filename. The mode of destination is set to 755 unless -m mode is specified.

backup any existing files before overwriting them by renaming them. (GNU appends '~' by default, BSDs appends .old by default)
Copy the file. 4.2BSD default behaviour is to move the binary unless -c is specified. Copying the file is now the default behaviour; the flag is maintained for backwards compatibility only.
BusyBox, suckless sbase, GNU coreutils, OpenBSD: Create any missing directories for destination (which still points to a file).
destdir
NetBSD, FreeBSD: Sets the DESTDIR (top of the file hierarchy) that the items are installed in to.
group
Sets group ownership. GNU: instead of the process' current group
mode
Sets alternative mode. The default mode is set to rwr-xr-x(0755).
owner
Sets user ownership.
Preserve file access and modification times.
executes strip(1) on each binary/file

There are many extra flags in GNU/*BSD versions of install(1) but this is kept to the common ones.

NetBSD 8.1, FreeBSD 12.1, OpenBSD 6.6, GNU coreutils 8.30, Busybox 1.30.1, 4.2BSD.

The install utility appeared in 4.2BSD.

Haelwenn (lanodan) Monnier <contact+c-u-d@hacktivis.me>

2019-11-16 Linux 6.12.21-gentoo-x86_64