XK0-006 · Question #26
A Linux systems administrator needs to extract the contents of a file named /home/dev/web.bkp to the /var/www/html/ directory. Which of the following commands should the administrator use?
The correct answer is B. pushd /var/www/html/ $$ cpio -idv < /home/dev/web.bkp && popd. The .bkp file here is a cpio archive, not a tar or zip. The correct way to extract it is by changing into the target directory (/var/www/html/) and using cpio -idv < /home/dev/web.bkp. The pushd and popd commands ensure the administrator returns to the original directory…
Question
A Linux systems administrator needs to extract the contents of a file named /home/dev/web.bkp to the /var/www/html/ directory. Which of the following commands should the administrator use?
Options
- Acd /var/www/html/ && gzip -c /home/dev/web.bkp | tar xf -
- Bpushd /var/www/html/ $$ cpio -idv < /home/dev/web.bkp && popd
- Ctar -c -f /home/dev/web.bkp /var/www/html/
- Dunzip -c /home/dev/web.bkp /var/www/html/
How the community answered
(41 responses)- A2% (1)
- B83% (34)
- C5% (2)
- D10% (4)
Explanation
The .bkp file here is a cpio archive, not a tar or zip. The correct way to extract it is by changing into the target directory (/var/www/html/) and using cpio -idv < /home/dev/web.bkp. The pushd and popd commands ensure the administrator returns to the original directory afterward.
Topics
Community Discussion
No community discussion yet for this question.