CompTIA Linux+ (XK0-004) — Question 166
A Linux administrator needs to back up the folder /usr/domain, and the output must be a gzip compressed tar. Which of the following commands should be used?
Answer options
- A. tar ג€"cv domain.tar.gz /usr/domain
- B. tar ג€"cvf /usr/domain domain.tar.gz
- C. tar ג€"czvf domain.tar.gz /usr/domain
- D. tar ג€"cxzv /usr/domain domain.tar.gz
Correct answer: C
Explanation
The correct command is option C, 'tar ג€"czvf domain.tar.gz /usr/domain', which correctly combines the options for creating a gzip compressed tar archive. Option A is missing the 'z' flag for gzip compression, option B is incorrect as it does not include the 'z' flag for compression and has the output and input paths reversed, and option D has an incorrect flag 'x' which is for extraction rather than creating an archive.