Basic usage of install command in Linux

Source: Internet
Author: User

Install and CP are similar, you can copy files/directories to the specified location. However, the install allows you to control the properties of the target file. The install is usually used for the makefile of the program, which is used to copy the program to the target (installation) directory.


Install (1) User Commands Install (1)


NAME

install-copy files and set attributes


Synopsis

Install [OPTION] ... [-T] SOURCE DEST

Install [OPTION] ... SOURCE ... DIRECTORY

Install [OPTION] ...-t DIRECTORY SOURCE ...

Install [OPTION] ...-d DIRECTORY ...

...


One main parameter:

-d,--directory: All parameters are processed as directories, and all home directories for the specified directory are created.

-g,--group= Group: Sets the owning group itself, not the group to which the process currently belongs.

-s,--strip: Remove the symbol table with the strip command only for the first and second use formats.

-s,--suffix= suffix: Specify the < suffix > for the backup file yourself.

-v,--verbose: Print the details of the install file.



The main differences between the two-install command and the CP command:


1, the most important point, if the target file exists, CP will first empty the file to write a new file, and install will delete the original file and then write a new file. This is because writing to a file that is in use can cause problems , such as writing to an executing file that might fail, such as writing a new file to a file handle that has been continuously written to produce the wrong file. The installation can be avoided by using install to delete and then write (generate a new file handle) .

2. The install command will properly handle the issue of file permissions. For example, INSTALL-C will set the permissions of the target file to Rwxr-xr-x;

3, the Install command can print more appropriate debug information, but also automatically handle the SELinux context problem.


Basic usage of install command in Linux

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.