A system administrator needs to quickly view the contents of a large, gzip-compressed log file named archive.log.gz. The administrator wants to display the full, uncompressed content of the file directly to the standard output without creating a new, uncompressed file on the filesystem. Which of the following commands will achieve this?
The correct command is zcat archive.log.gz. The zcat utility is specifically designed to decompress files to standard output, allowing a user to view the contents without modifying the original compressed file. The command cat archive.log.gz would incorrectly display the raw, compressed binary data to the terminal, not the human-readable text. The command gunzip archive.log.gz would decompress the file in place, replacing archive.log.gz with archive.log, which is not the desired outcome as it modifies the filesystem and does not print to standard output. The command zless archive.log.gz opens the compressed file in an interactive pager (less), which allows for scrolling but does not send the entire content to standard output as requested.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the purpose of the zcat command?
Open an interactive chat with Bash
How is zcat different from gunzip?
Open an interactive chat with Bash
Can zcat be used with other compression formats?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
System Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access