install 命令:
單源複製:
install [OPTION]... [-T] SOURCE DEST
多源複製:
install [OPTION]... SOURCE... DIRECTORY
install [OPTION]... -t DIRECTORY SOURCE...
創建目錄:
install [OPTION]... -d DIRECTORY...
選項:
-m, --mode=MODE:設定目標文件權限,默認爲755;
-o, --owner=OWNER:設定目標文件屬主;
-g, --group=GROUP:設定目標文件屬組;
-d,創建目錄
實例:
[root@itxuezhe tmp]# ls -l /etc/inittab
-rw-r--r--. 1 root root 511 8月 4 2017 /etc/inittab
[root@itxuezhe tmp]# install -m 640 /etc/inittab /tmp/
[root@itxuezhe tmp]# ls -l /tmp/inittab
-rw-r-----. 1 root root 511 2月 23 20:55 /tmp/inittab
創建目錄
[root@itxuezhe tmp]# install -d hello
[root@itxuezhe tmp]# ll -d hello/
drwxr-xr-x. 2 root root 6 2月 23 20:57 hello/