CompTIA Linux+ (XK0-004) — Question 12

A Linux systems administrator needs to copy the contents of a directory named `working` on the local working system to a folder /var/www/html on a server named `corporate-web`.
Which of the following commands will allow the administrator to copy all the contents to the web server?

Answer options

Correct answer: A

Explanation

The correct command is A, as scp is specifically designed for secure copying over SSH, and the -r flag allows for recursive copying of directories. Option B is incorrect because tar is used for archiving and not for direct copying to a remote server. Option C uses cp which does not support copying files directly to a remote server, and Option D attempts to move the directory rather than copy the contents.