Basic CommandsLesson 10Free preview
Bash Copy (cp)
This lesson is part of Bash · All levels
Summary
The cp command copies a file or directory from source to destination. To copy the folder you need the -r option to copy the entire contents. The -i option is useful for Bash to ask before he hits an existing file.
Key points
- Cp source of the file to copy
- r is required to copy the directory
- I warned you before you hit.
- p retains the permissions and timing of the original file
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.