utility
cp
Copy source to destination. May overwrite existing files; use a new destination in the fixture.
Formal Syntax & Structure
bash syntaxbash
cp [OPTION] SOURCE DESTParameters & Attributes
| Name | Type | Description |
|---|---|---|
| SOURCE | path | Source file. |
| DEST | path | New destination. |
Return Value
exit status
Exit status 0 on success; nonzero indicates failure or a command-specific condition. See description and example.
Working Example
Example Snippetbash
printf 'notes\n' > './-draft notes.txt'cp -- '-draft notes.txt' 'copy notes.txt'cat -- 'copy notes.txt'