CompTIA Linux+ (XK0-004) — Question 110
A raw VM image is being compressed with bzip2 and copied to a flash drive at /dev/hdb for off-site use by the marketing department. Which of the following command lines accomplishes this task?
Answer options
- A. mv /vm/mkgt.img | bzip2 /dev/hdb/mkgt.img.bz2
- B. bzip2 ג€"c /vm/mktg.img | dd of=/dev/hdb
- C. cp /vm/mktg.img | bzip2 /dev/hdb/mktg.img.bz2
- D. cp ג€"a ג€"r /vm/mktg.img bzip2 /dev/hdb/mktg.img.zip
Correct answer: C
Explanation
The correct option, C, uses the cp command to copy the VM image and pipes it through bzip2 to compress it while saving it to /dev/hdb. Option A incorrectly uses mv instead of cp, which will not work for this task. Option B uses dd instead of copying directly to the destination, which is not the intended method here. Option D incorrectly attempts to use cp with bzip2 in a way that does not properly handle the compression and output redirection.