install 中文man頁面
NAME[名稱]
install - 復制文件并設置屬性
SYNOPSIS[總覽]
install [options] [-s] [--strip] source dest
install [options] [-s] [--strip] source... directory
install [options] [-d,--directory] directory...
選項(最短格式):
[-b] [-c] [-D] [-g group] [-m mode] [-o owner] [-S SUFFIX] [-V {numbered,existing,simple}] [--help] [--version] [--]
DESCRIPTION(描述)
install 復制文件并設置它們的權限模式,如果可能,還將設置其所有者和組別.
在第一種調用格式中, source 文件被復制為 dest 目標文件. 在第二種格式中,每個 source 文件都被復制到目的端 directory 中. 在最后一種格式中,將創建每個 directory (以及任何缺失的父目錄).
install 類似于 cp, 不過它允許你控制目的文件的屬性. 它的典型應用是 Makefile 文件中復制程序到它們的目標目錄中. 它拒絕復制文件為其自身.
OPTIONS(選項)
- -c
- 可忽略;這是為了與老Unix版本的 install 相兼容.
- -d, --directory
- 創建每個給定的目錄以及任何缺失的父目錄, 按照命令行要求來設置所有者,組別和模式,或者設為默認值. 它也授予任何它創建的父目錄以這些屬性. (這有別于SunOS 4.x的 install, 該 install 授予其創建目錄以默認的屬性.)
- -D
- 創建 dest 的所有前面部分,只有最后一個除外,然后復制 source 到 dest. 該選項在如上總覽中列出的第一種格式中有用. (fileutils-4.0中的新功能.)
- -g group, --group=group
- 設置安裝的文件或目錄的組所有權為 group 這可能是組名,或者是數字化組標識.
- -m mode, --mode=mode
- 設置安裝的文件或目錄的權限為 mode, 這可以為八進制數,也可以為 chmod 中的符號化的模式,且都以0開頭.默認的模式是0755 - 對所有者可讀,可寫并且可執行,對于組用戶和其它用戶可讀和可執行.
- -o owner, --owner=owner
- 如果 install 有合適的特權(運行為root),則設置安裝的文件或目錄的所有權為 owner. 默認為'root'. owner 可以為用戶名,也可以為數字化用戶標識.
- -s, --strip
- 從安裝的二進制可執行程序剝離符號表.
GNU BACKUP OPTIONS(GNU備份選項)
GNU版本的程序如 cp, mv, ln, install 和 patch 會按需求對將要被覆蓋,修改或者毀壞的文件進行備份. 所需要的備份文件由-b選項指定. 它們怎樣命名則由-V選項確定. 在備份文件名通過后綴擴展方式給定的情況下,該后綴由-S選項確定.
- -b, --backup
- 備份那些將要被覆蓋或者移除的文件.
- -S SUFFIX, --suffix=SUFFIX
- 添加 SUFFIX 到每個生成的備份文件后. 如果該選項未被確定,那么將使用 SIMPLE_BACKUP_SUFFIX 環境變量.又如果 SIMPLE_BACKUP_SUFFIX 未設置,那么默認為'~'.
- -V METHOD, --version-control=METHOD
- 確定備份文件怎樣命名. METHOD 參數可以為'numbered'(或者't'),'existing'(或者'nil'),或'never'(或者'simple'). 如果未指定該選項,將使用 VERSION_CONTROL 環境變量.又如果 VERSION_CONTROL 未設置,那么默認的備份類型為'existing'.
該選項相當于Emacs變量'version-control'.有效的 METHODs 有(只接受唯一的縮寫方式):
- t, numbered
- 總作數碼標識的備份.
- nil, existing
- 對已有文件作數碼標識的備份,而對其它文件作簡單備份.
- never, simple
- 總作簡單備份.
- 確定備份文件怎樣命名. METHOD 參數可以為'numbered'(或者't'),'existing'(或者'nil'),或'never'(或者'simple'). 如果未指定該選項,將使用 VERSION_CONTROL 環境變量.又如果 VERSION_CONTROL 未設置,那么默認的備份類型為'existing'.
GNU STANDARD OPTIONS(GNU標準選項)
- --help
- 在標準輸出上打印一條用法信息,并以成功狀態退出.
- --version
- 在標準輸出上打印版本信息,然后以成功狀態退出.
- --
- 終止選項列表.
ENVIRONMENT(環境變量)
變量LANG, LC_ALL, LC_CTYPE和LC_MESSAGES取其常用義.對于GNU的版本,如上所述,變量 SIMPLE_BACKUP_SUFFIX和VERSION_CONTROL控制著備份文件的命名.
CONFORMING TO(遵循規則)
BSD 4.2 (它帶有-c, -m, -o, -g和-s選項).
NOTES(備注)
本頁介紹了包含在fileutils-4.0包中的 install ; 其他版本可能會有細微差別. 請把您的修正和增補建議發郵件到aeb@cwi.nl. 報告程序中的bug請發到 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.