tldr/pages/common/install.md

30 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

2016-12-21 23:37:17 +00:00
# install
> Copy files and set attributes.
> Copy files (often executable) to a system location like `/usr/local/bin`, give them the appropriate permissions/ownership.
> More information: <https://www.gnu.org/software/coreutils/install>.
2016-12-21 23:37:17 +00:00
- Copy files to the destination:
2016-12-21 23:37:17 +00:00
`install {{path/to/source_file1 path/to/source_file2 ...}} {{path/to/destination}}`
2016-12-21 23:37:17 +00:00
- Copy files to the destination, setting their ownership:
2016-12-21 23:37:17 +00:00
`install --owner {{user}} {{path/to/source_file1 path/to/source_file2 ...}} {{path/to/destination}}`
2016-12-21 23:37:17 +00:00
- Copy files to the destination, setting their group ownership:
2016-12-21 23:37:17 +00:00
`install --group {{user}} {{path/to/source_file1 path/to/source_file2 ...}} {{path/to/destination}}`
2016-12-21 23:37:17 +00:00
- Copy files to the destination, setting their `mode`:
2016-12-21 23:37:17 +00:00
`install --mode {{+x}} {{path/to/source_file1 path/to/source_file2 ...}} {{path/to/destination}}`
2016-12-21 23:37:17 +00:00
- Copy files and apply access/modification times of source to the destination:
2016-12-21 23:37:17 +00:00
`install --preserve-timestamps {{path/to/source_file1 path/to/source_file2 ...}} {{path/to/destination}}`
- Copy files and create the directories at the destination if they don't exist:
`install -D {{path/to/source_file1 path/to/source_file2 ...}} {{path/to/destination}}`