PrepAway - Latest Free Exam Questions & Answers

Which of the following commands should John use to accomplish his task?

John is a newly appointed Network technician at McNeil Inc. The company has a Linux-based
Network. John is currently working on the /tmp directory. The /tmp directory has a file named
file3.txt. John wants to copy this file in a subdirectory named backup of his home directory
/home/John. Which of the following commands should John use to accomplish his task?
Each correct answer represents a complete solution. Choose three.

PrepAway - Latest Free Exam Questions & Answers

A.
cp file3.txt /home/John/backup

B.
cp file3.txt /home/John/backup/

C.
cp file3.txt backup

D.
cp file3.txt ~/backup

Explanation:

The cp command in option A will copy file3.txt to the destination /home/john/backup. The source
and destination paths have been used correctly.
In option D ~ refers to home directory so it is also the correct destination path.
In option B appending / to the destination just tells the cp command explicitly that you are referring
to a directory, not a file.


Leave a Reply