Which command copies the contents of the directory /etc/, including all sub-directories, to /root/?
Which command copies the contents of the directory /etc/, including all sub-directories, to /root/?
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.
B is the correct answer.
Both -R and -r are correct See: https://linux.die.net/man/1/cp
And thus answer B is correct.