No products in the cart.
CompTIA Linux+ Exam Questions
Page 9 of 25
161.
An administrator is troubleshooting an issue that occurred after updating an application on a Debian-based system. They want to check if the problem is being caused by a broken dependency. Which of these commands can they use to check this?
-
apt-get check
-
rpm -aV
-
patch
-
gcc
Correct answer: apt-get check
The apt-get check command will check for dependencies on a Debian-based system.
The rpm command is used on Red Hat-based systems. The patch command adds patch files to source code. The gcc command is for compiling source code.
162.
A developer wants to start using version control for some software they are working on. Which is a popular service for hosting software under version control?
-
GitHub
-
AWS
-
Azure
-
Kubernetes
Correct answer: GitHub
GitHub is a popular service for keeping version-controlled projects in a remote repository.
AWS and Azure are cloud service providers. Kubernetes is an open-source orchestration system.
163.
Which permissions does Linux give to a new file by default?
-
666
-
664
-
644
-
600
Correct answer: 666
The default file permissions are 666, which are read and write permissions for user, group, and others.
664 permissions are read and write for user and group but only read for others. 644 permissions are read and write for user but only read for group and others. 600 permissions are only read and write for the user.
164.
An administrator wants to add a rule to UFW that blocks SSH access from the 192.168.0.0 class C subnet. What command will accomplish this?
-
ufw deny from 192.168.0.0/24 to any port 22
-
ufw insert from 192.168.0.0/24 to any port 22
-
ufw allow from 192.168.0.0/24 to any port 22
-
ufw in from 192.168.0.0/24 to any port 22
Correct answer: ufw deny from 192.168.0.0/24 to any port 22
The deny argument to the ufw will deny packets to the supplied identifiers.
The insert argument will insert the rule at a specific index. The allow argument will let the packets pass. The in setting applies rules to only incoming traffic.
165.
An administrator wants to search the /etc/passwd file to see if a user named "bsmith" is there. What command will search the file and return the line number where the user's information is?
-
grep -n bsmith /etc/passwd
-
grep -l bsmith /etc/passwd
-
grep -i bsmith /etc/passwd
-
grep -r bsmith /etc/passwd
Correct answer: grep -n bsmith /etc/passwd
The grep command with the -n option will show the line number in the file where it was found.
The -l option only displays the filename where the string occurs. The -i option ignores case when searching. The -r option will search recursively through subdirectories to find matches.
166.
Which signal is sent by the default kill command?
-
TERM
-
INT
-
HUP
-
KILL
Correct answer: TERM
The kill command sends the TERM signal, which will try to gracefully end the process.
To send the INT, HUP, or KILL signals, they must be specified in the command.
167.
An administrator wants to increase the network bandwidth available to a system. What type of bonding should they implement on the network interfaces?
-
Aggregation
-
Active/passive
-
Broadcast
-
Load balancing
Correct answer: Aggregation
With aggregation, two or more network interfaces can appear as one interface to increase bandwidth. Bonding should first be initialized by adding the module with a command like "modprobe bonding."
With active/passive, one interface is working while the other is staying idle as a backup. Broadcast is a mode that transmits packets on all interfaces. Load balancing shares the traffic between the network interfaces for redundancy.
168.
Which command will let an administrator enter the specific quota amounts for groups?
-
edquota -g
-
quota -g
-
repquota -a
-
quotacheck
Correct answer: edquota -g
The edquota command lets an administrator edit user and group quotas. This command will open a text editor, where you can edit the settings. The -u option is for users and -g is for group quotas.
The quota -g command is for checking quota limits. The repquota -a command is for making a report on the filesystem's quotas. The quotacheck command is for creating the quota setup files.
169.
A programmer wants to take an existing Git project and duplicate its repository into a new directory. Which Git command will accomplish this?
-
clone
-
branch
-
pull
-
add
Correct answer: clone
The clone command duplicates a repository into a new directory.
The branch command lists, creates, and deletes branches from a Git repository. The pull command pulls from a remote repository and merges with the local repository. The add command adds a file to the Git repository.
170.
Which operator is used to send both standard output and standard error to the same file?
-
&>
-
>
-
2>
-
>>
Correct answer: &>
The &> operator is useful if you want to record both the expected output and any error messages in an output file.
The > operator is for standard output. The 2> operator is for standard error. The >> operator will append standard output rather than overwrite.
171.
In GRUB2, where can the scripts used to build GRUB's configuration variables be found?
-
/etc/grub.d
-
/etc/default/grub
-
grub.cfg
-
/boot/grub/grub.lst
Correct answer: /etc/grub.d
In GRUB2, the directory /etc/grub.d contains GRUB scripts that are processed in order of the names.
GRUB variables such as GRUB_TIMEOUT, GRUB_DEFAULT, and GRUB_DISTRIBUTOR are stored in /etc/default/grub. Grub.cfg is used with some versions of GRUB (Legacy) to configure the GRUB menu. The /boot/grub/grub.lst is a fictitious file.
172.
An administrator wants to be able to dynamically change the size of partitions on a filesystem. What should they use to accomplish this?
-
LVM
-
APT
-
EXT
-
mdadm
Correct answer: LVM
Logical Volume Management (LVM) allows for creating dynamic volumes instead of partitions. It is useful for creating systems that will have little downtime.
The Advanced Package Tool (APT) is the front-end manager of the dpkg system. EXT is a type of filesystem in Linux that supports large file sizes. The mdadm tool is for managing RAID devices.
173.
Which folder has the highest-priority rules.d file that udev will use to recognize plugged-in devices?
-
/etc/udev
-
/lib/udev
-
/usr/lib/udev
-
/proc/sys
Correct answer: /etc/udev
The /etc/udev/rules.d file has the highest priority. Rules are searched in dictionary order, with later rules overriding earlier rules.
System default rules are in /lib/udev or /usr/lib/udev. The /proc/sys folder is virtual and gives information on the kernel.
174.
A user wants to use the output of one script as the input to another. Which symbol should they use to accomplish this?
-
|
-
>
-
<
-
#
Correct answer: |
The pipe symbol (|) redirects output to another command. This allows for commands to be chained together.
The greater-than symbol (>) is used to redirect standard output to a file. The less-than symbol (<) is used for standard input. The pound sign (#) is used for comments in a script.
175.
An administrator wants to add a default route of 192.168.1.1 to the primary Ethernet interface. Which command will accomplish this?
-
route add default gw 192.168.1.1 eth0
-
route del default gw 192.168.1.1 eth0
-
route add -net 192.168.1.1
-
route -n
Correct answer: route add default gw 192.168.1.1 eth0
You can add a route with the add option to the route command and then, specify that it is the default gateway, insert the gateway address, and specify the network interface.
The del option will delete a route. The command route add -net 192.168.1.1 is missing a gateway address. The command route -n will verify routes.
176.
An administrator needs to add more virtual memory to a system. They want to see if the current swap is a file or a partition before doing any operations. Which command should they use for this?
-
swapon -s
-
swapoff -s
-
mkswap
-
sar
Correct answer: swapon -s
The swapon command can show if swap space is a file or a partition. It can also add a swap file by using the file name as the option to the command.
The swapoff command is for removing swap files. The mkswap command is used to format a portion into a swap partition. The sar command is used to view memory statistics on a system.
177.
An administrator needs to convert text-based source code into a binary executable file. Which tool can be used to accomplish this?
-
make
-
tar
-
curl
-
apt-get
Correct answer: make
The make command uses a compiler to generate an executable file. This command can be run at the root level of the untarred source code provided that all the necessary information is in the Makefile file at that level.
The tar command is for creating an archive file. The curl command is for downloading files. The apt-get utility is for working with packages.
178.
An administrator recently started using a new kernel without making any changes to the system's modules or libraries. Now, the system is continually crashing. Which term describes the issue that is occurring?
-
Kernel panic
-
Bootloading
-
Kernel buffering
-
System shutdown
Correct answer: Kernel panic
A kernel panic is when the kernel detects an unrecoverable error. It happens to prevent data loss or corruption.
Bootloading is the process of loading up an operating system. Kernel buffering can refer to the kernel ring buffer that displays the kernel boot messages. A system shutdown is an ordered process that is not the result of an error.
179.
Which Linux feature uses the /dev/mapper device and allows for fault tolerance in getting from a Linux system to a network storage device?
-
Multipath
-
Virtual directory
-
mdadm
-
GPT
Correct answer: Multipath
Device Mapper Multipathing (DM-multipathing) allows for the configuration of multiple paths between a Linux system and a network storage device. Partitions can be created on the device just as with normal drives.
Virtual directories refer to the directory structure that allows multiple drives under the root filesystem. The mdadm command is for setting up RAID devices. GPT is a method for managing partitions.
180.
An administrator wants to check if anyone is logged into a server before restarting it. Which command gives a list of users currently logged in?
-
who
-
whoami
-
id
-
chage
Correct answer: who
The who command will show users logged into the system. It displays their username, terminal, and time of login.
The whoami command shows the effective account name of the currently logged-in user. The chage command allows an administrator to change password configuration information.