nerdexam
CompTIA

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…

System Configuration and Management

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)
  • A
    2% (1)
  • B
    83% (34)
  • C
    5% (2)
  • D
    10% (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

#cpio#backup extraction#archive management#file restoration

Community Discussion

No community discussion yet for this question.

Full XK0-006 Practice