A system administrator needs to compress a large log file named access.log to save disk space. However, the original access.log file must be retained for an ongoing analysis process. Which of the following commands will create a compressed file named access.log.gz while leaving the original access.log file unmodified?
The correct command is gzip -k access.log. The -k (or --keep) option instructs gzip to keep the input (source) file after compression. By default, gzip deletes the original file. The command gzip access.log would compress the file but also remove the original access.log. The command gzip -d access.log would attempt to decompress the file, not compress it. The command gzip -c access.log sends the compressed output to standard output, and while it does not delete the original file, it does not create the access.log.gz file without output redirection.
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 'gzip -k' option?
Open an interactive chat with Bash
How does 'gzip -c' differ from 'gzip -k'?
Open an interactive chat with Bash
What happens if you run 'gzip access.log' without any options?
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