A system administrator needs to create a compressed backup of the /var/log directory. Which command should they use to create a gzip-compressed archive file named log_backup.tar.gz?
The correct answer is tar -czvf log_backup.tar.gz /var/log because the options -c create a new archive, -z filter the archive through gzip for compression, -v produce verbose output, showing all processed files, and -f specify the filename of the archive. The incorrect options either do not specify gzip compression, which is required to produce a .gz file, or use options that perform actions other than creating an archive, such as extracting files or listing the contents of an archive.
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 do the options -c, -z, -v, and -f mean in the tar command?
Open an interactive chat with Bash
What is the difference between -x, -t, and -c options in the tar command?
Open an interactive chat with Bash
Why is gzip compression important in creating backups?