What does / usr / sbin / install really do?

I am trying to install discount on my Solaris-based VPS and compilation works fine after setting some environment variables, but it crashes .

So, I thought I would do the installation manually, but what does install really do? Is it just a mv followed by a chmod ? This is magic? Does this error seem to indicate that it is trying to search a lot for files around the world?

Can I copy binaries, libraries, and header files as usual?

Googling "install" does not give me a lot of important information, so I appreciate any clarification I can get!

+6
install makefile
source share
1 answer

According to man install :

 install [OPTION]... [-T] SOURCE DEST` install [OPTION]... SOURCE... DIRECTORY install [OPTION]... -t DIRECTORY SOURCE... install [OPTION]... -d DIRECTORY... 

In the first three forms, copy SOURCE to DEST or several SOURCE (s) into an existing DIRECTORY, when setting permissions and owner / group modes. In the 4th form, create all the components of this DIRECTORY (s).

Regarding the difference from using cp , according to install vs. cp; and mmap , install disables the existing file, creating a new one associated with the same location.

This has the advantage that if the file you are trying to overwrite is the currently running program, it can continue to work because the file that is being written is actually in a new location and the existing program code is still in the old one.

A cp simply trying to overwrite an existing file, which will fail if the file is locked due to use.

Additional Information

+8
source share

All Articles