CompTIA Linux+ (XK0-004) — Question 301

A technician wants to archive and compress all files and folders contained within the /home/user directory.
Which of the following commands should the technician execute?

Answer options

Correct answer: B

Explanation

The correct command is B because it uses 'tar' with the 'c' (create), 'v' (verbose), 'f' (file), and 'z' (gzip) options, which are suitable for archiving and compressing the contents of the /home/user directory into a .tar.gz file. Option A is incorrect as it attempts to extract files rather than create an archive, while option C uses the wrong compression format (zip instead of gzip), and option D also tries to extract rather than create an archive.