010-160 Exam QuestionsBrowse all questions from this exam

010-160 Exam - Question 64


Which command copies the contents of the directory /etc/, including all sub-directories, to /root/?

Show Answer
Correct Answer: B

To copy the contents of the directory /etc/, including all sub-directories, to /root/, the command 'cp -r /etc/* /root' is appropriate. The '-r' flag (or '-R') stands for 'recursive', which enables copying of all directories and their contents recursively. Using 'cp -r /etc/* /root' ensures that all files and subdirectories from /etc/ are transferred to /root.

Discussion

2 comments
Sign in to comment
beazzlebubOption: B
Jul 26, 2021

B is the correct answer.

FM221228Option: B
Oct 2, 2022

Both -R and -r are correct See: https://linux.die.net/man/1/cp

FM221228
Oct 2, 2022

And thus answer B is correct.