install命令
install - copy files and set attributes 复制文件和设置文件属性
install [OPTION]... [-T] SOURCE DEST # 单源复制
install [OPTION]... SOURCE... DIRECTORY # 多源复制
install [OPTION]... -t DIRECTORY SOURCE... # 多源复制
install [OPTION]... -d DIRECTORY... # 创建空目录
举例
install /etc/inittab /tmp # 将etc目录下的nttab文件 复制到tmp目录下
-rwxr-xr-x 1 root root 511 Aug 14 00:11 inittab 默认权限为755了
install -m 640 /etc/inittab /tmp # 将etc目录下的nttab文件 复制到tmp目录下 制定权限为640
-rw-r----- 1 root root 511 Aug 14 00:14 inittab 权限为640了
install -d hello # 创建一个hello 空目录
drwxr-xr-x 2 root root 4096 Aug 14 00:18 hello # 创建一个hello 空目录 默认权限为755
常见选项
-m, --mode=MODE
set permission mode (as in chmod), instead of rwxr-xr-x # 设置文件权限 默认755
-o, --owner=OWNER
set ownership (super-user only)# 设定目标文件属主
-g, --group=GROUP
set group ownership, instead of process' current group # 设定目标文件的属组
linux的install命令
最新推荐文章于 2025-07-05 07:00:00 发布