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

Prepare for the LPI Linux Essentials 010-160 Test with our comprehensive quiz platform offering flashcards and multiple choice questions. Hints and explanations provided for each question. Get exam-ready with ease!

The selected command is appropriate because it is specifically designed to copy the entire contents of the /etc/ directory, including all sub-directories and their contents, to the /root/ directory. The use of the -r (or --recursive) option allows the command to traverse through all directories and subdirectories, ensuring that everything under /etc/ is duplicated accurately in the destination.

In contrast, the first option would not work as intended because it tries to copy the /etc/ directory itself, not its contents, which can lead to the destination containing an empty directory rather than the desired files. The third option is irrelevant in this context since it employs the mv command, which would move (rather than copy) the directory and its contents instead of duplicating them. Lastly, the fourth option refers to a non-existent command, as 'copy' is not recognized in most Linux distributions for this function, further indicating why it wouldn't be suitable for this task.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy