Files
tldr/pages.zh/common/install.md

29 lines
1.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 安装
> 复制文件并设置属性。
> 将文件(通常是可执行文件)复制到系统位置,例如 `/usr/local/bin`,并赋予适当的权限/所有权。
> 更多信息请访问:<https://www.gnu.org/software/coreutils/install>。
- 将文件复制到目标位置:
`install {{path/to/source_file1 path/to/source_file2 ...}} {{path/to/destination}}`
- 将文件复制到目标位置,并设置它们的所有权:
`install --owner {{user}} {{path/to/source_file1 path/to/source_file2 ...}} {{path/to/destination}}`
- 将文件复制到目标位置,并设置它们的组所有权:
`install --group {{user}} {{path/to/source_file1 path/to/source_file2 ...}} {{path/to/destination}}`
- 将文件复制到目标位置,并设置它们的 `mode`
`install --mode {{+x}} {{path/to/source_file1 path/to/source_file2 ...}} {{path/to/destination}}`
- 复制文件并将源文件的访问/修改时间应用到目标文件:
`install --preserve-timestamps {{path/to/source_file1 path/to/source_file2 ...}} {{path/to/destination}}`
- 复制文件并在目标位置创建目录(如果不存在):
`install -D {{path/to/source_file1 path/to/source_file2 ...}} {{path/to/destination}}`