Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the install command in Linux

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to use the install command in Linux. Xiaobian thinks it is quite practical, so share it with you as a reference. I hope you can gain something after reading this article.

install [OPTION]... SOURCE... DIRECTORYinstall [OPTION]... -t DIRECTORY SOURCE... install [OPTION]... -d DIRECTORY... function

Copy files and set properties, install can install or upgrade software or backup data, its use rights are all users.

described

In the first two formats, copies to or copies multiple files to existing, setting permission mode and owner/group.

In the third format, all specified directories and their home directories are created. Parameters required for long options are also required for short options.

Main parameters:

-backup[=CONTROL]: Make a backup for each existing destination file.

-b: Similar to-backup, but takes no arguments.

-c: (This option is not processed).

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

-D: All home directories before creation, then made available in the first usage format.

-g, -group= group: Set the group to which the process belongs instead of the group to which it currently belongs.

-m, -mode= mode: Self-set permission mode (like chmod ) instead of rwxr-xr-x.

-o, -owner= owner: Set the owner yourself (applies to superusers only).

-p, -preserve-timestamps: time attribute of destination file with file access/modification time.

-s, -strip: Delete symbol table with strip command, only applies to the first and second usage formats.

-S, -suffix= suffix: Specify the backup file by yourself.

-v, -verbose: Print the name of each file/directory as it is processed.

-version: Display version information and leave.

-help: Display this help message and leave.

example

Copy test to directory dir1

$install test dir1

Here, copy the test file to dir1 directory. If there is test in dir1, it will be replaced; directory will not be automatically created. dir1 must already exist, otherwise test will be copied to dir1 file.

Create dir2/dir21/directory

$install -d dir2/dir21

This will create a dir2/dir21 directory, if it exists, it will not be overwritten, if it does not exist then create such a multi-level directory.

Copy test1 test2 files to dir1 directory

$install -t dir1 test1 test2

Here, copy the test1 and test2 files to dir1 directory, if there is no directory will not be automatically created.

other

This command does not seem to be commonly used, man manual content is not much, you can now check, generally I often see the use of this command in the software makefile.

About "how to use install command in Linux" this article is shared here, I hope the above content can be of some help to everyone, so that you can learn more knowledge, if you think the article is good, please share it to let more people see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report