RHEL Linux - Red Hat System Administration Practice Exam

Disable ads (and more) with a membership for a one time $4.99 payment

Study for the RHEL Linux - Red Hat System Administration Exam. Enhance your knowledge with flashcards and multiple-choice questions, complete with hints and explanations. Prepare for your certification!

Practice this question and more.


'[root@serverX~]$ tar cjf /root/logbackup.tar.bz12 /var/log' What will this command do?

  1. create a gzip-compressed archive of /var/log

  2. create a bzip2-compressed archive of /var/log

  3. create a zip-compressed archive of /var/log

  4. create a non-compressed archive of /var/log

The correct answer is: create a bzip2-compressed archive of /var/log

The command provided is using the `tar` utility, which is commonly used for creating archives in Linux. The specific flags in the command are crucial for understanding its functionality. The `c` flag indicates that the command is creating an archive, the `j` flag specifies that the archive should be compressed using bzip2, and the `f` flag allows you to specify the name of the archive file that will be created. The output file specified is `/root/logbackup.tar.bz12`, and since bzip2 compression is indicated by the `j` flag, this command will create a bzip2-compressed archive of the contents of the directory `/var/log`. Thus, the correct answer reflects that the primary operation of this command is to compress the specified directory using bzip2, resulting in a more efficient storage format compared to uncompressed versions. Knowing about the other options provides context: gzip is indicated by the `z` flag, which is not present in this command, and zip is a different compression format that is not managed by tar. Additionally, a non-compressed archive would not use the `j` flag, as this flag indicates compression. Therefore, the nature of the flags confirms that the command creates a b