2018-11-12 11:32:24 +00:00
|
|
|
---
|
|
|
|
layout: page
|
|
|
|
category-page: intermediate
|
2018-11-16 12:47:48 +00:00
|
|
|
category-title: Intermediate commands
|
2018-11-12 11:32:24 +00:00
|
|
|
author: Marco Farace
|
|
|
|
title: install
|
|
|
|
---
|
2018-11-15 20:09:21 +00:00
|
|
|
|
2018-11-12 12:46:51 +00:00
|
|
|
The file(s) are copied to the target file or directory. If the destination
|
|
|
|
is a directory, then the file is copied into directory with its original
|
|
|
|
filename. If the target file already exists, it is either renamed to
|
|
|
|
file.old if the -b option is given or overwritten if permissions allow.<br>
|
|
|
|
An alternate backup suffix may be specified via the -B option's argument.<br>
|
|
|
|
Basic syntax is in the form
|
|
|
|
|
|
|
|
<pre>
|
|
|
|
install [OPTION]... SOURCE DEST
|
2018-11-18 17:39:51 +00:00
|
|
|
</pre>
|
2018-11-12 12:46:51 +00:00
|
|
|
|
|
|
|
This line of code copies all .xyz file from <i>/source/folder</i> to <i>/destination/folder</i>
|
|
|
|
|
|
|
|
<pre>
|
|
|
|
install -D /source/folder/*.xyz /destination/folder
|
2018-11-18 17:39:51 +00:00
|
|
|
</pre>
|
2018-11-12 12:46:51 +00:00
|
|
|
|
|
|
|
<h3>Flags</h3>
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
<li>-b: Back up any existing files before overwriting them by renaming
|
|
|
|
them to file.old. See -B for specifying a different backup suffix.
|
|
|
|
(-B suffix Use suffix as the backup suffix if -b is given)</li>
|
|
|
|
<li>-C: Copy the file. If the target file already exists and the files
|
|
|
|
are the same, then don't change the modification time of the target</li>
|
|
|
|
<li>-d: Create directories. Missing parent directories are created as required.</li>
|
|
|
|
<li>-f: Specify the target's file flags; see chflags(1) for a list of
|
|
|
|
possible flags and their meanings.</li>
|
|
|
|
<li>-g: Specify a group. A numeric GID is allowed.</li>
|
|
|
|
<li>-m: Specify an alternate mode. The default mode is set to rwxr-xr-x
|
|
|
|
(0755). The specified mode may be either an octal or symbolic
|
|
|
|
value.</li>
|
|
|
|
<li>-o: Specify an owner. A numeric UID is allowed.</li>
|
|
|
|
</ul>
|