CompTIA Linux+ Exam Questions

Page 10 of 25

181.

An administrator needs to install hundreds of Linux installations, so they decide to use SUSE Linux Enterprise Server's AutoYaST service. What type of solution are they utilizing?

  • Build automation

  • Inventory management

  • Agent orchestration

  • Version control

Correct answer: Build automation

Build automation can mean implementing mass installations of an operating system. It can also refer to building app containers. 

Inventory management refers to keeping the same number of app containers running if some of them crash. Agent orchestration involves monitoring an app container from within the app. Version control refers to registering an application before moving it to production.

182.

An administrator wants to run an integrity check on the first partition of the second hard drive. The drive is still mounted. What command should the administrator run FIRST to perform the check?

  • umount /dev/sdb1

  • fsck /dev/sdb1

  • mount /dev/sdb1

  • e2fsck /dev/sdb1

Correct answer: umount /dev/sdb1

Before running a filesystem check, the drive should be unmounted. The umount command will unmount the drive specified in the argument to the command. 

The fsck command will perform an integrity check after the drive has been unmounted. The mount command will mount a drive. The e2fsck command will be run from the fsck command if that is the filesystem type.

183.

An administrator wants to create a high-priority swap partition. Which of the following commands will create the highest priority?

  • mkswap /dev/dsb2 -p 3

  • mkswap /dev/dsb2

  • mkswap /dev/dsb2 -p 1

  • mkswap /dev/dsb2 -p -1

Correct answer: mkswap /dev/dsb2 -p 3

The mkswap command creates a swap area on a partition. The -p option will set a priority, with the higher number having priority. 

Not setting a priority will give the partition a negative priority number.

184.

Which of the following files is a global configuration file?

  • /etc/bashrc

  • ~./.bash_profile

  • ~./.bash_login

  • ~/.profile

Correct answer: /etc/bashrc

The file /etc/bashrc applies to all users. This file may be named bash.bashrc, depending on the Linux distribution. 

The other files are located in users' home directories and can be customized for each user.

185.

How does Linux put physical devices into its virtual directory?

  • Mount points

  • Symbolic link

  • Relative path

  • Bonding

Correct answer: Mount points

Mount points are folders that point to a physical device. They can be located at any location in the file system. 

Symbolic links are files or folders that point to another file or folder. Relative path refers to pointing to another directory without giving its absolute path. Bonding refers to ways to associate network interface cards together.

186.

Which command will show new kernel messages whenever a new device is added?

  • dmesg

  • lsdev

  • lpr

  • udevadmin

Correct answer: dmesg

The dmesg command will show the kernel's ring buffer, which is a file that gets its messages overwritten as the buffer fills up. This can be used in conjunction with the grep command to extract relevant information. 

The lsdev command gets information about hardware from the /proc directory. The lpr command is for submitting print jobs. The udevadmin command is for managing and getting information about system devices.

187.

Which of the following is a markup language that is a superset of JSON and is used to configure Kubernetes elements?

  • YAML

  • OVA

  • YUM

  • GRUB

Correct answer: YAML

Yet Another Markup Language (YAML) has all the features of JSON and is used in languages like Ruby and Python. It is used when configuring Docker or Kumbernetes elements. 

OVA is a format for archiving OVF files. YUM is used for managing software packages. GRUB is a bootloader program.

188.

A process is in a state where it is waiting for a signal from the kernel. What state is it in?

  • Interruptible sleep

  • Uninterruptible sleep

  • Zombie

  • Traced

Correct answer: Interruptible sleep

A process that is in the interruptible sleep state is waiting for a signal from the processor. 

A process in the uninterruptible sleep state will wake up from an external event like hardware becoming available. A process in the zombie state has not been acknowledged by its parent process as being killed. A process in the traced, or stopped, state will not have the kernel perform any actions until it is resumed.

189.

An administrator wants to view all the devices that are currently mounted. Which file holds this information?

  • /etc/mtab

  • /etc/fstab

  • /etc/crypttab

  • /etc/hosts

Correct answer: /etc/mtab

The /etc/mtab has a list of currently mounted devices and is created automatically by the system. A device's entry in this file can be copied to the /etc/fstab file to be auto-mounted upon booting. 

The /etc/fstab file has devices that will be automatically mounted. The /etc/crypttab file allows for automatically mounting encrypted devices. The /etc/hosts file is for resolving hostnames to IP addresses.

190.

Which utility measures a disk's latency in real time?

  • ioping

  • du

  • df

  • noop

Correct answer: ioping

The ioping command can test disk latency, seek rates, and sequential speeds. The -c option will limit the number of pings to the specified number.

The du command gives disk usage for directories and subdirectories. The df command gives information about disk usage on a filesystem. The noop command is for scheduling I/O requests.

191.

Which interface is ideal for working with devices like lights, sensors, and motors, such as for use with a small utility system like a Raspberry Pi?

  • GPIO

  • PCI

  • USB

  • HBA

Correct answer: GPIO

The General Purpose Input/Output (GPIO) interface is popular for automation projects. It is ideal for working with devices like lights, sensors, and motors, such as for use with a small utility system like a Raspberry Pi. It has multiple digital input and output lines that can be controlled down to a single bit. 

Peripheral Component Interconnect (PCI) boards are used for devices like hard drives, NICs, and video cards. Universal Serial Bus (USB) interfaces are popular for devices like external drives, cameras, keyboards, and printers. Host Bus Adaptors (HBA) are used for IDE, SCSI, and SATA controllers.

192.

An administrator creates a public/private key pair with the command ssh-keygen -t rsa. Where will the private key be stored?

  • ~/.ssh/id_rsa

  • ~/.ssh/id_rsa.pub

  • ~/.ssh/authorized_keys

  • ~/.ssh/known_hosts

Correct answer: ~/.ssh/id_rsa

A private key will be stored at ~/.ssh/id_rsa. The filename will change depending on the encryption method used. 

The public key will be stored at ~/.ssh/id_rsa.pub. The ~/.ssh/authorized_keys file is for logging in without a password. The ~/.ssh/known_hosts file is for storing public keys of servers they have been connected to.

193.

An administrator is NOT seeing the latest versions of packages in the repository. What command should they run to address this situation?

  • apt-get update

  • apt-get upgrade

  • apt-get clean

  • apt-get source

Correct answer: apt-get update

The update action to the apt-get command will retrieve updated package information from the repository. It doesn't actually update packages on the system, though. 

The upgrade action will upgrade all installed packages to the latest version. The clean action will clean up the database and temporarily downloaded files. The source action will retrieve the source code for a specified package.

194.

Which compression utility is able to operate on multiple files?

  • zip

  • xz

  • gzip

  • bzip2

Correct answer: zip

The zip utility is able to operate on multiple files by packing them into a single file. 

The other utilities only work on single files.

195.

A developer wants to write a web app that can be neatly packaged with its libraries and operating system. They do not want the package components to be upgradeable and want the package to be easily scalable. What type of construct should they use for their web app?

  • Container

  • Agent

  • Clone

  • Repository

Correct answer: Container

A container is an app that is packaged with an operating system and necessary libraries. The components of a container cannot be updated, but the containers can be replaced. 

An agent refers to monitoring software located within an app. Cloning is a term in git that duplicates a repository. A repository is where a version-controlled software project is located.

196.

Which directory in /etc/apparmor.d contains global variable definitions that let profiles work in various environments?

  • tunables

  • pam.d

  • securetty

  • modprobe.d

Correct answer: tunables

The tunables directory has files that define variables that make it easy to change the behavior of a profile without modifying the profile directly. The profiles are located in /etc/apparmor.d. 

The /etc/pam.d directory is for Linux's Pluggable Authentication Modules (PAM). The file /etc/securetty defines terminals, which root is allowed to log in from. The /etc/modprobe.d directory is for configuration files for modules.

197.

A user wants to run a script that will modify environment variables within the script but without affecting the system environment variables. What command will let them accomplish this?

  • env

  • set

  • export

  • echo

Correct answer: env

The env command will run a script in an environment in which it will not modify system environment variables. It can also be used to print environment variables. 

The set command is used to display and set names and values of environment variables. The export command is used to make a variable available to child processes. The echo command displays the string that is passed to it as an argument. 

198.

A programmer creates a script that accepts a limited number of predetermined responses from a user. They want to make custom output based on users' responses. Which logic construct would BEST suit outputting their responses?

  • case

  • while

  • for

  • if

Correct answer: case

The case construct expects certain values from a variable. If those values are predictable, it is efficient to use this construct. 

A while loop iterates while a condition is true. A for loop iterates through every element in a series. An if statement tests if a condition is true and then runs a block of code.

199.

Where are messages stored when using auditing with SELinux?

  • /var/log/audit/audit.log

  • /var/log/messages

  • /var/log/syslog

  • /var/log/lastlog

Correct answer: /var/log/audit/audit.log

When auditing is enabled, messages are stored in /var/log/audit/audit.log. The sealert command can be used to read this file. 

The /var/log/messages file has global system messages from the kernel and daemons. The /var/log/syslog file logs everything but authentication messages. The lastlog command logs information about when users last logged in.

200.

An administrator wants to be able to boot an operating system remotely. What feature should the system's network card support to allow this?

  • PXE

  • ISO

  • MEMDISK

  • GRUB2

Correct answer: PXE

Preboot Execution Environment (PXE) allows for a client with a PXE-enabled network card and PXE boot device in flash memory to be able to be booted remotely. The client can receive its network configuration from a DHCP server and a boot image from a TFTP server. 

An ISO image is a file that has the complete contents of a drive on it. MEMDISK is a utility to boot DOS from SYSLINUX bootloaders. GRUB2 is a Linux bootloader used when booting locally.