Difficulty: Easy
Correct Answer: cp wb collect mon ../misc
Explanation:
Introduction / Context:
On UNIX-like systems, copying multiple files into a target directory is accomplished using the cp
command. Understanding relative paths (such as ../misc
) helps navigate and manage files efficiently across sibling directories.
Given Data / Assumptions:
programs
directory.misc
one level up: ../misc
.
Concept / Approach:
Use cp
followed by a list of source files and the destination directory. A relative path beginning with ../
refers to the parent directory; appending misc
targets the sibling directory named misc.
Step-by-Step Solution:
Confirm current directory with pwd
and listing with ls
.Execute: cp wb collect mon ../misc
.Verify: ls ../misc
now shows wb, collect, mon.
Verification / Alternative check:
Try copying with wildcards (e.g., cp w*
if patterns match). Use cp -i
to prompt before overwrite or cp -v
for verbose output.
Why Other Options Are Wrong:
Option A uses DOS syntax (copy
), not UNIX cp
, and repeats the destination unnecessarily.Option C again uses DOS copy
and an absolute path /misc
that likely is not intended.Option D uses tar
, which is for archiving, not simple copying to a directory argument.
Common Pitfalls:
/misc
with relative ../misc
.-i
or backups.
Final Answer:
cp wb collect mon ../misc
Discussion & Comments