install

v0.0.28
install [OPTION]... [FILE]...

Copy SOURCE to DEST or multiple SOURCE(s) to the existing DIRECTORY, while setting permission modes and owner/group

Options

--backup=<CONTROL>

make a backup of each existing destination file

-b

like --backup but does not accept an argument

-c

ignored

--compare, -C

compare each pair of source and destination files, and in some cases, do not modify the destination at all

--directory, -d

treat all arguments as directory names. create all components of the specified directories

-D

create all leading components of DEST except the last, then copy SOURCE to DEST

--group=<GROUP>, -g <GROUP>

set group ownership, instead of process's current group

--mode=<MODE>, -m <MODE>

set permission mode (as in chmod), instead of rwxr-xr-x

--owner=<OWNER>, -o <OWNER>

set ownership (super-user only)

--preserve-timestamps, -p

apply access/modification times of SOURCE files to corresponding destination files

--strip, -s

strip symbol tables (no action Windows)

--strip-program=<PROGRAM>

program used to strip binaries (no action Windows)

--suffix=<SUFFIX>, -S <SUFFIX>

override the usual backup suffix

--target-directory=<DIRECTORY>, -t <DIRECTORY>

move all SOURCE arguments into DIRECTORY

--no-target-directory, -T

(unimplemented) treat DEST as a normal file

--verbose, -v

explain what is being done

--preserve-context, -P

(unimplemented) preserve security context

--context=<CONTEXT>, -Z <CONTEXT>

(unimplemented) set security context of files and directories

Examples

Copy files to the destination:

install {{path/to/source_file1 path/to/source_file2 ...}} {{path/to/destination}}

Copy files to the destination, setting their ownership:

install --owner {{user}} {{path/to/source_file1 path/to/source_file2 ...}} {{path/to/destination}}

Copy files to the destination, setting their group ownership:

install --group {{user}} {{path/to/source_file1 path/to/source_file2 ...}} {{path/to/destination}}

Copy files to the destination, setting their mode:

install --mode {{+x}} {{path/to/source_file1 path/to/source_file2 ...}} {{path/to/destination}}

Copy files and apply access/modification times of source to the destination:

install --preserve-timestamps {{path/to/source_file1 path/to/source_file2 ...}} {{path/to/destination}}

Copy files and create the directories at the destination if they don't exist:

install -D {{path/to/source_file1 path/to/source_file2 ...}} {{path/to/destination}}

The examples are provided by the tldr-pages project under the CC BY 4.0 License.

Please note that, as uutils is a work in progress, some examples might fail.