A system administrator is preparing an off-server backup before rotating log files. They want to create a single gzip-compressed archive named log_backup.tar.gz that contains the entire /var/log directory so it can be transferred to external storage. Which command accomplishes this task?
tar -czvf log_backup.tar.gz /var/log uses -c to create a new archive, -z to compress the archive with gzip so it ends with .gz, -v to show verbose progress, and -f to specify the output file name. The other commands either extract (-x), list (-t), or omit the -z flag, so they do not create the required gzip-compressed 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 does each tar option (-c, -z, -v, -f) do?
Open an interactive chat with Bash
What is the difference between gzip and other compression tools like bzip2 or xz?
Open an interactive chat with Bash
How can you verify the contents of a tar.gz file without extracting it?