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?
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
B won't work, because you have the bzip2 command and then only half of the dd cmd. you cant just have an output to dd, you also need an input. Also running bzip2 with dd makes no sense.
B will work, look at the man pages for bzip, the -c command is a valid argument. The command says send the std out of the command to a byte by byte copy (dd) of the /dev/hdb location.
bzip2 -c mktg.img | dd of=/home/shahin/hosts-test/copiedfile.img
0+1 records in
0+1 records out
14 bytes copied, 3.927e-05 s, 357 kB/s
---------------------------------------------------------------------
ls -la
.rw-rw-r-- shahin shahin 14 B Sun May 16 16:59:36 2021 copiedfile.img
The whole syntax is terribly wrong. First of all, missing destination for cp command. Right syntax would be cp 'file-you-want-copy' 'destination'. Secondly, you cannot copy any file to the location of the device like /dev/sdb.
B does work indeed. Adding "-c" to bzip2 will write the compressed info to STDOUT. Also, the pipe send that to "dd" command. When used with a pipe, there is no need to provide "if" attribute to dd command. Thie can be tested like this: "bzip2 -c file | dd of=compressed_file.bz2"
upvoted 5 times
...
This section is not available anymore. Please use the main Exam Page.XK0-004 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
FilipIT
Highly Voted 4 years, 3 months agoSfutrell
Highly Voted 4 years, 1 month agoshahin_am2
3 years, 11 months agoLinux1020
3 years agoshahin_am2
3 years, 11 months agoNathanf123
Most Recent 3 years, 2 months agoluken7777
1 year, 9 months agorjrpaz
3 years, 11 months ago