Technically, the difference between install -c
and cp
is that install
sets the permissions of the target file to rwxr-xr-x
. cp
preserves the permissions of the source file minus the umask. These default behaviors are useful in different situations. Obviously, with all the options that both cp
and install
offer nowadays, the functionalities have converged.
Nowadays, install
is commonly used in makefiles, cp
everywhere else. This distinction is occasionally useful because some operating systems or installation systems allow you to hook into the install
program to register the installed packages. Modern package management systems make this kind of obsolete, but some people still use it. Also, the possibility to set the target file permissions in the same go is very convenient.
3Good answer. But see also
cp --remove-destination
in GNU coreutils. – Peter Eisentraut – 2014-01-02T19:00:21.787