System Management
A web server's configuration was damaged. A gzip-compressed tar backup at /backup/web.tar.gz was created with relative paths, so its members are named etc/hosts, etc/httpd/conf/httpd.conf and so on. An administrator needs to restore only the etc/hosts file into the /tmp/restore directory for review, without extracting anything else or changing the live system. Which command does this?
Show the answer
Correct answerC. tar -xzf /backup/web.tar.gz -C /tmp/restore etc/hosts
The -x option extracts, -z decompresses gzip, -f names the archive, -C sets the destination directory, and the trailing member name limits extraction to that file. The -xjf form is tempting but -j expects bzip2, so it fails on a gzip archive.