Red Hat System Administration II with RHCSA Exam Quiz Questions and Answers

A user who is a member of several groups wants to change default group ownership for all newly created files and set it to group sales. Which command would do that?

Answer :
  • newgrp sales

Explanation :

The newgrp command is used to set the effective primary group, which will effect default group ownership on new files until the current shell session is ended. The chgrp command is used to set the group owner of an existing file. Chgrp is not related to any user account and it affects newly created files only.

Which command prints the fourth field of a line in the /etc/passwd file if the text user occurs in that line?

Answer :
  • awk -d : ‘/user/ { print $4 }’ /etc/passwd

Explanation :

The awk command first needs to know which field separator should be used. This is specified with the -F : option. Then, it needs to specify a string that it should look for, which is /user/ . To indicate that the fourth field of a matching file should be printed, you need to include the { print $4 } command.

How can you check whether hardware virtualization support is enabled on your server's CPU?

Answer :
  • cat /proc/cpuinfo
  • lscpu

Explanation :

Look for the vmx flag in /proc/cpuinfo to verify the availability of hardware virtualization support or for the svm flag (for AMD cpus). The lscpu command shows the hypervisor mode a host is offering, and if used on a virtual machine it shows which type of virtualization platform this machine is used on.

What commands should you use (along with appropriate options) to learn the value of a specific environment variable? (Select two)

Answer :
  • env
  • echo

Explanation :

The env command displays all defined environment variables, so option A satisfies the question. (In practice, you might pipe the results through grep to find the value of a specific environment variable.) The echo command, when passed the name of a specif

Which of the following is the name of the text user interface to specify network connection properties?

Answer :
  • nmtui

Explanation :

On RHEL 7, nmtui is the default utility to set and modify the network interface. Notice that RHEL 7 does not have system-config utilities anymore for configuring networking that were available in earlier versions of RHEL.

Which command enables you to ping all IPv6 nodes that are on the local network that is connected through the eth0 interface?

Answer :
  • ping6 ff02::1%eth0

Explanation :

On RHEL 7, nmtui is the default utility to set and modify the network interface. Notice that RHEL 7 does not have system-config utilities anymore for configuring networking that were available in earlier versions of RHEL.

Which command enables you to find out the yum ID number that is needed to roll back a command that was issued with yum?

Answer :
  • yum history

Explanation :

Explanation: The yum history command reads the /var/log/yum.log file and shows recent yum history. In this list, every event is marked with a history number that can be used with the yum history undo command.

Which directory is mainly used by cron files that are installed automatically through RPM?

Answer :
  • /etc/cron.d

Explanation :

The /etc/cron.d directory is used to store cron files for individual services that need tasks to be executed through cron. This directory is mostly filled by installing RPM files that contain cron jobs.