2014-01-28 09:53:43 +00:00
|
|
|
# cp
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
> Copy files.
|
2014-01-28 09:53:43 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Copy files in arbitrary locations:
|
2014-01-28 09:53:43 +00:00
|
|
|
|
|
|
|
`cp {{/path/to/original}} {{/path/to/copy}}`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Copy a file to a parent directory:
|
2014-01-28 09:53:43 +00:00
|
|
|
|
2015-12-29 02:11:10 +00:00
|
|
|
`cp {{/path/to/original}} ../{{path/to/copy}}`
|
2014-01-28 09:53:43 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Copy directories recursive using the option -r:
|
2014-01-28 09:53:43 +00:00
|
|
|
|
|
|
|
`cp -r {{/path/to/original}} {{/path/to/copy}}`
|
2015-12-29 02:11:10 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Show files as they are copied:
|
2015-12-29 02:11:10 +00:00
|
|
|
|
2014-02-10 23:44:02 +00:00
|
|
|
`cp -vr {{/path/to/original}} {{/path/to/copy}}`
|
2014-01-28 09:53:43 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Make a copy of a file, adding an extension:
|
2015-12-29 02:11:10 +00:00
|
|
|
|
|
|
|
`cp {{file.html}}{,.backup}`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Make a copy of a file, changing the extension:
|
2014-01-28 09:53:43 +00:00
|
|
|
|
2015-12-29 02:11:10 +00:00
|
|
|
`cp {{file.}}{html,backup}`
|