XK0-005 · Question #753
A Linux systems administrator needs to compress a file named passwords.txt. The compressed file should be saved as passwords.txt.gz. Which of the following commands should the administrator use to…
The correct answer is A. gzip -c passwords.txt > passwords.txt.gz. The gzip command with the -c flag outputs the compressed data to standard output, which can then be redirected to create a .gz file. This approach maintains the original file while creating a compressed version.
Question
A Linux systems administrator needs to compress a file named passwords.txt. The compressed file should be saved as passwords.txt.gz. Which of the following commands should the administrator use to accomplish this task?
Options
- Agzip -c passwords.txt > passwords.txt.gz
- Bgzip -d passwords.txt | passwords.txt.gz
- Cgzip -n passwords.txt > passwords.txt.gz
- Dgzip -n passwords.txt < passwords.txt.gz
How the community answered
(24 responses)- A75% (18)
- B4% (1)
- C8% (2)
- D13% (3)
Explanation
The gzip command with the -c flag outputs the compressed data to standard output, which can then be redirected to create a .gz file. This approach maintains the original file while creating a compressed version.
Topics
Community Discussion
No community discussion yet for this question.