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.
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 /employeecommand uses-xfor extract, which is used to decompress and extract files from an archive, not to create a backup. - D. The
tar -Tpf backup.tar.gz /employeecommand uses-pfor preserving permissions and-Tto 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
Topics
Community Discussion
No community discussion yet for this question.