install 中文man頁面
NAME[名稱]
install - 復(fù)制文件并設(shè)置屬性
SYNOPSIS[總覽]
install [options] [-s] [--strip] source dest
install [options] [-s] [--strip] source... directory
install [options] [-d,--directory] directory...
選項(xiàng)(最短格式):
[-b] [-c] [-D] [-g group] [-m mode] [-o owner] [-S SUFFIX] [-V {numbered,existing,simple}] [--help] [--version] [--]
DESCRIPTION(描述)
install 復(fù)制文件并設(shè)置它們的權(quán)限模式,如果可能,還將設(shè)置其所有者和組別.
在第一種調(diào)用格式中, source 文件被復(fù)制為 dest 目標(biāo)文件. 在第二種格式中,每個(gè) source 文件都被復(fù)制到目的端 directory 中. 在最后一種格式中,將創(chuàng)建每個(gè) directory (以及任何缺失的父目錄).
install 類似于 cp, 不過它允許你控制目的文件的屬性. 它的典型應(yīng)用是 Makefile 文件中復(fù)制程序到它們的目標(biāo)目錄中. 它拒絕復(fù)制文件為其自身.
OPTIONS(選項(xiàng))
- -c
- 可忽略;這是為了與老Unix版本的 install 相兼容.
- -d, --directory
- 創(chuàng)建每個(gè)給定的目錄以及任何缺失的父目錄, 按照命令行要求來設(shè)置所有者,組別和模式,或者設(shè)為默認(rèn)值. 它也授予任何它創(chuàng)建的父目錄以這些屬性. (這有別于SunOS 4.x的 install, 該 install 授予其創(chuàng)建目錄以默認(rèn)的屬性.)
- -D
- 創(chuàng)建 dest 的所有前面部分,只有最后一個(gè)除外,然后復(fù)制 source 到 dest. 該選項(xiàng)在如上總覽中列出的第一種格式中有用. (fileutils-4.0中的新功能.)
- -g group, --group=group
- 設(shè)置安裝的文件或目錄的組所有權(quán)為 group 這可能是組名,或者是數(shù)字化組標(biāo)識(shí).
- -m mode, --mode=mode
- 設(shè)置安裝的文件或目錄的權(quán)限為 mode, 這可以為八進(jìn)制數(shù),也可以為 chmod 中的符號(hào)化的模式,且都以0開頭.默認(rèn)的模式是0755 - 對(duì)所有者可讀,可寫并且可執(zhí)行,對(duì)于組用戶和其它用戶可讀和可執(zhí)行.
- -o owner, --owner=owner
- 如果 install 有合適的特權(quán)(運(yùn)行為root),則設(shè)置安裝的文件或目錄的所有權(quán)為 owner. 默認(rèn)為'root'. owner 可以為用戶名,也可以為數(shù)字化用戶標(biāo)識(shí).
- -s, --strip
- 從安裝的二進(jìn)制可執(zhí)行程序剝離符號(hào)表.
GNU BACKUP OPTIONS(GNU備份選項(xiàng))
GNU版本的程序如 cp, mv, ln, install 和 patch 會(huì)按需求對(duì)將要被覆蓋,修改或者毀壞的文件進(jìn)行備份. 所需要的備份文件由-b選項(xiàng)指定. 它們?cè)鯓用麆t由-V選項(xiàng)確定. 在備份文件名通過后綴擴(kuò)展方式給定的情況下,該后綴由-S選項(xiàng)確定.
- -b, --backup
- 備份那些將要被覆蓋或者移除的文件.
- -S SUFFIX, --suffix=SUFFIX
- 添加 SUFFIX 到每個(gè)生成的備份文件后. 如果該選項(xiàng)未被確定,那么將使用 SIMPLE_BACKUP_SUFFIX 環(huán)境變量.又如果 SIMPLE_BACKUP_SUFFIX 未設(shè)置,那么默認(rèn)為'~'.
- -V METHOD, --version-control=METHOD
- 確定備份文件怎樣命名. METHOD 參數(shù)可以為'numbered'(或者't'),'existing'(或者'nil'),或'never'(或者'simple'). 如果未指定該選項(xiàng),將使用 VERSION_CONTROL 環(huán)境變量.又如果 VERSION_CONTROL 未設(shè)置,那么默認(rèn)的備份類型為'existing'.
該選項(xiàng)相當(dāng)于Emacs變量'version-control'.有效的 METHODs 有(只接受唯一的縮寫方式):
- t, numbered
- 總作數(shù)碼標(biāo)識(shí)的備份.
- nil, existing
- 對(duì)已有文件作數(shù)碼標(biāo)識(shí)的備份,而對(duì)其它文件作簡單備份.
- never, simple
- 總作簡單備份.
- 確定備份文件怎樣命名. METHOD 參數(shù)可以為'numbered'(或者't'),'existing'(或者'nil'),或'never'(或者'simple'). 如果未指定該選項(xiàng),將使用 VERSION_CONTROL 環(huán)境變量.又如果 VERSION_CONTROL 未設(shè)置,那么默認(rèn)的備份類型為'existing'.
GNU STANDARD OPTIONS(GNU標(biāo)準(zhǔn)選項(xiàng))
- --help
- 在標(biāo)準(zhǔn)輸出上打印一條用法信息,并以成功狀態(tài)退出.
- --version
- 在標(biāo)準(zhǔn)輸出上打印版本信息,然后以成功狀態(tài)退出.
- --
- 終止選項(xiàng)列表.
ENVIRONMENT(環(huán)境變量)
變量LANG, LC_ALL, LC_CTYPE和LC_MESSAGES取其常用義.對(duì)于GNU的版本,如上所述,變量 SIMPLE_BACKUP_SUFFIX和VERSION_CONTROL控制著備份文件的命名.
CONFORMING TO(遵循規(guī)則)
BSD 4.2 (它帶有-c, -m, -o, -g和-s選項(xiàng)).
NOTES(備注)
本頁介紹了包含在fileutils-4.0包中的 install ; 其他版本可能會(huì)有細(xì)微差別. 請(qǐng)把您的修正和增補(bǔ)建議發(fā)郵件到aeb@cwi.nl. 報(bào)告程序中的bug請(qǐng)發(fā)到 fileutils-bugs@gnu.ai.mit.edu.
#p#
NAME
ginstall - copy files and set attributes
SYNOPSIS
install [OPTION]... SOURCE DEST (1st format)
install [OPTION]... SOURCE... DIRECTORY (2nd format)
install -d [OPTION]... DIRECTORY... (3rd format)
DESCRIPTION
In the first two formats, copy SOURCE to DEST or multiple SOURCE(s) to the existing DIRECTORY, while setting permission modes and owner/group. In the third format, create all components of the given DIRECTORY(ies).
Mandatory arguments to long options are mandatory for short options too.
- --backup[=CONTROL] make a backup of each existing destination file
- -b
- like --backup but does not accept an argument
- -c
- (ignored)
- -C
- Install file, unless target already exists and is the same as the new file, in which case the modification time won't be changed.
- -d, --directory
- treat all arguments as directory names; create all components of the specified directories
- -D
- create all leading components of DEST except the last, then copy SOURCE to DEST; useful in the 1st format
- -g, --group=GROUP
- set group ownership, instead of process' current group
- -m, --mode=MODE
- set permission mode (as in chmod), instead of rwxr-xr-x
- -o, --owner=OWNER
- set ownership (super-user only)
- -p, --preserve-timestamps
- apply access/modification times of SOURCE files to corresponding destination files
- -s, --strip
- strip symbol tables, only for 1st and 2nd formats
- -S, --suffix=SUFFIX override the usual backup suffix
- -v, --verbose
- print the name of each directory as it is created
- -P, --preserve_context (SELinux) Preserve security context
- -Z, --context=CONTEXT
- (SELinux) Set security context of files and directories
- --help
- display this help and exit
- --version
- output version information and exit
The backup suffix is `~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX. The version control method may be selected via the --backup option or through the VERSION_CONTROL environment variable. Here are the values:
- none, off
- never make backups (even if --backup is given)
- numbered, t
- make numbered backups
- existing, nil
- numbered if numbered backups exist, simple otherwise
- simple, never
- always make simple backups
AUTHOR
Written by David MacKenzie.
REPORTING BUGS
Report bugs to <bug-coreutils@gnu.org>.
COPYRIGHT
Copyright © 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
SEE ALSO
The full documentation for install is maintained as a Texinfo manual. If the info and install programs are properly installed at your site, the command
- info coreutils install
should give you access to the complete manual.