Difficulty: Easy
Correct Answer: cp programs/wb misc
Explanation:
Introduction / Context:
On UNIX/Linux systems, file copy operations use the cp command. To copy a single file into a target directory preserving its filename, you specify the source path followed by the destination directory. Mastering cp syntax is essential for reliable file management and scripting.
Given Data / Assumptions:
Concept / Approach:
When the destination is a directory, cp places the source file inside it with the same name. If you wanted to rename the file, you would specify the new filename after the destination directory path. The command differs from DOS/Windows copy syntax and from archiving tools like tar.
Step-by-Step Solution:
Verification / Alternative check:
Compare checksums (for example, sha256sum programs/wb misc/wb) to confirm a perfect copy. If permissions differ, add cp -p.
Why Other Options Are Wrong:
a: copy is a DOS command, not UNIX cp.
c: tar is for archiving; not a simple copy.
d: DOS-style drive letters are not used on UNIX.
e: Not applicable, option b is correct.
Common Pitfalls:
Forgetting that an existing misc/wb may be overwritten; using relative paths from the wrong working directory; confusing cp with mv (move/rename).
Final Answer:
cp programs/wb misc
Discussion & Comments