nerdexam
CompTIACompTIA

XK0-005 · Question #294

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

The correct answer is A: tar -zcvf backup.tar.gz /employee. To back up and compress files using tar, the correct command combines options for creation, verbosity, compression, and specifying the archive file and source directory.

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 back up and compress files using tar, the correct command combines options for creation, verbosity, compression, and specifying the archive file and source directory.

Common mistakes.

  • B. The -x option is used to extract files from an archive, not to create one.
  • D. The -T option is used to read file names to be archived from a file, and -p preserves permissions, but it lacks the -c (create) and -z (compress) options needed for the stated goal.

Concept tested. Tar archive creation with gzip compression

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

Topics

#tar command#File archiving#File compression#Linux backups

Community Discussion

No community discussion yet for this question.

Full XK0-005 PracticeBrowse All XK0-005 Questions