1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2024-11-02 07:18:29 +01:00
tldr/pages/common/cp.md

28 lines
530 B
Markdown
Raw Normal View History

2014-01-28 10:53:43 +01:00
# cp
> Copy files.
2014-01-28 10:53:43 +01:00
- Copy files in arbitrary locations:
2014-01-28 10:53:43 +01:00
`cp {{/path/to/original}} {{/path/to/copy}}`
- Copy a file to a parent directory:
2014-01-28 10:53:43 +01:00
`cp {{/path/to/original}} ../{{path/to/copy}}`
2014-01-28 10:53:43 +01:00
- Copy directories recursive using the option -r:
2014-01-28 10:53:43 +01:00
`cp -r {{/path/to/original}} {{/path/to/copy}}`
- Show files as they are copied:
`cp -vr {{/path/to/original}} {{/path/to/copy}}`
2014-01-28 10:53:43 +01:00
- Make a copy of a file, adding an extension:
`cp {{file.html}}{,.backup}`
- Make a copy of a file, changing the extension:
2014-01-28 10:53:43 +01:00
`cp {{file.}}{html,backup}`