nerdexam
CompTIACompTIA

XK0-005 · Question #1289

XK0-005 Question #1289: Real Exam Question with Answer & Explanation

The correct answer is A: tar -zcvf backup.tar.gz /employee. To create a compressed archive of the /employee directory, the tar command with the appropriate options for creation and gzip compression should be used.

System Management

Question

A directory called /employee is shared with many employees in a company. New hardware was acquired, and the systems administrator needs to back up all files in /employee before the server is replaced. Which of the following commands should be used to back up all the files and compress them to use little space in the filesystem?

Options

  • Atar -zcvf backup.tar.gz /employee
  • Btar -zxvf backup.tar.gz /employee
  • Dtar -Tpf backup.tar.gz /employee

Explanation

To create a compressed archive of the /employee directory, the tar command with the appropriate options for creation and gzip compression should be used.

Common mistakes.

  • B. The tar -zxvf backup.tar.gz /employee command uses -x for extract, which is used to decompress and extract files from an archive, not to create a backup.
  • D. The tar -Tpf backup.tar.gz /employee command uses -p for preserving permissions and -T to specify a file with names to extract or create, not suitable for simple directory backup and compression.

Concept tested. tar command for archiving and compression

Reference. https://man7.org/linux/man-pages/man1/tar.1.html

Topics

#tar command#File compression#Backup operations#Linux utilities

Community Discussion

No community discussion yet for this question.

Full XK0-005 PracticeBrowse All XK0-005 Questions