The application team is having issues accessing their data in their /app filesystem. Given the following outputs:  Which of the following is the reason for this issue?
-
A
The fllesystem was mounted incorrectly.
-
B
The /etc/fstab configuration is wrong.
-
C
A physical volume is missing.
-
D
The data has been deleted.
Reveal answer details
Close answer details
Correct answerC
ExplanationThe volume group reports a missing physical volume by UUID, and vgdata is shown with one unknown physical volume. Because lvdata depends on that incomplete volume group, XFS cannot reliably access its storage and shuts down after an I/O error. The /app entry points to the expected logical volume, so the failure is below the mount configuration.
Which of the following describes PEP 8?
-
A
The style guide for Python code
-
B
Python virtual environments
-
C
A package installer for Python
-
D
A Python variable holding octal values
Reveal answer details
Close answer details
Correct answerA
ExplanationPEP 8 is the style guide for Python code. It defines conventions for readable and consistent source, including layout, indentation, naming, imports, and related formatting practices. It is not a virtual-environment mechanism, package installer, or variable type; those functions are separate from guidance about how Python source should be written.
Question 3
Multiple choice
A new user is experiencing issues creating files in the folder /home/testuser/testdir/. The directory needs to be accessible for reading by other users in the system. The administrator gathers the following information: drwxr-xr-x. 2 root testuser 6 Oct 19 11:22 testdir Which of the following commands should the administrator use to solve the issue? (Select TWO.)
-
A
chmod u+w /home/testuser/testdir/
-
B
-
C
chmod g+w /home/testuser/testdir/
-
D
-
E
chown newuser /home/testuser
Reveal answer details
Close answer details
Correct answersA, C
ExplanationThe directory is owned by root with group ownership assigned to testuser. Its current permissions allow the group to read and access the directory but not create files. Adding group write permission allows members of testuser to create files while preserving read access for others. Adding root to the testuser group ensures the directory owner account is also associated with the group used for collaborative access.
A Linux administrator is working with a CPU-intensive program called data-analysis. The administrator needs to prevent the program from monopolizing CPU resources and ensure that other critical processes are not impacted when the program starts. Which of the following commands would start the program with a reduced level of impact to the system?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerB
ExplanationThe nice command starts a process with an adjusted scheduling priority. When no explicit value is provided, nice increases the niceness value by 10 by default, giving the new process a lower CPU scheduling priority than processes running at the default niceness. This reduces the likelihood that the CPU-intensive program will monopolize processor resources and helps other important processes remain responsive.
A web application that uses a database for managing logins needs to be set up so that the database is running before the web server starts. A Linux administrator, who is troubleshooting the issue, reviews systemd unit files:  Which of the following should the Linux administrator do to ensure the database starts first?
-
A
Enable the HTTPD service using the httpd command.
-
B
Add mariadb.service to the Wants for the HTTPD service configuration
-
C
Add Before=httpd.service to the MariaDB configuration.
-
D
Add mariadb. service to the HTTPD service configuration.
Reveal answer details
Close answer details
Correct answerC
ExplanationThe existing unit relationships do not establish that MariaDB must precede HTTPD. Adding Before=httpd.service to the MariaDB service configuration creates the required systemd ordering: when both units are scheduled, MariaDB is started before HTTPD. A Wants relationship can pull in another unit but does not by itself impose startup order, so it cannot guarantee the database-first sequence.
A Linux software developer wants to use AI to optimize source code used in a commercial product. Which of the following steps should the developer take first?
-
A
Research which available AI chatbots are best at optimizing source code.
-
B
Verify that the company has a policy governing the use of AI in software development.
-
C
Install a private LLM to use on the internal network for source code optimization.
-
D
Use open-source LLMs that undergo regular security reviews by the community.
Reveal answer details
Close answer details
Correct answerB
ExplanationBefore placing commercial source code into an AI workflow, the developer must verify the company's policy governing AI use in software development. That policy establishes whether the activity is permitted and what handling requirements apply to company code. Choosing a chatbot, installing a private model, or selecting an open-source model comes afterward because none of those technical choices replaces organizational authorization.
An administrator has generated an RSA SSH key pair to log in to a remote server. After copying the public key and attempting to log in, the administrator sees the following message: [email protected]: Permission denied (publickey,password) After seeing the message, the administrator attempts to connect using ssh -v [email protected] and notices the following debug output: debug1: send_pubkey_test: no mutual signature algorithm Which of the following actions should the administrator take first to remediate this issue?
-
A
Issue systemctl restart sshd on the local server.
-
B
Create a new key pair by running ssh-keygen -t ecdsa.
-
C
Set PermitRootLogin yes in the /etc/ssh/sshd_config file.
-
D
Update permissions on the /home/admin/.ssh directory to 700 on the remote server.
Reveal answer details
Close answer details
Correct answerB
ExplanationThe diagnostic message states that the client and server have no mutual signature algorithm for the existing RSA public key. Creating a new key pair with ssh-keygen -t ecdsa supplies a different key and signature type that can be mutually supported. Root-login policy and directory permissions do not resolve an algorithm negotiation failure.
A systems administrator engineer wants to configure a Linux server’s time zone to America/Chicago. The engineer verifies that the server’s time zone is configured for Asia/Tokyo:  Which of the following commands should the engineer execute to make this change?
-
A
date configure -set-timezone America/Chicago
-
B
set-timezone -config America/Chicago
-
C
time date set America/Chicago
-
D
timedatectl set-timezone America/Chicago
Reveal answer details
Close answer details
Correct answerD
ExplanationThe timedatectl utility is used on systemd-based Linux systems to view and modify system date, time, and time zone settings. The set-timezone command changes the configured time zone to the specified value, so timedatectl set-timezone America/Chicago correctly changes the server from Asia/Tokyo to America/Chicago without affecting the active NTP synchronization configuration.
A DevOps engineer made some changes to files in a local repository. The engineer realizes that the changes broke the application and the changes need to be reverted back. Which of the following commands is the best way to accomplish this task?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerB
Explanationgit reset moves the repository state back to a chosen commit and resets staged content to match that point. With the appropriate reset mode, the engineer can also discard the broken working-tree changes. Pull retrieves remote work, rebase rewrites commit placement, and stash preserves changes rather than reverting them.
Question 10
Multiple choice
A systems administrator receives reports of issues in one of the Linux systems. The following output has been provided: $ dig node.mycomptia.org ; <<>> DiG 9.11.36 <<>> node.mycomptia.org ;; global options: +cmd ;; connection timed out; no servers could be reached $ cat /etc/resolv.conf search mycomptia.org Which of the following actions will best resolve this issue? (Select two.)
-
A
echo "8.8.8.8 node.mycomptia.org" >> /etc/hosts
-
B
echo "nameserver 8.8.8.8" >> /run/systemd/resolve/resolv.conf
-
C
systemctl restart networkd
-
D
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
-
E
echo "DNS1=8.8.8.8" >> /etc/sysconfig/network-scripts/ifcfg-eth0
-
F
systemctl restart NetworkManager
-
G
Reveal answer details
Close answer details
Correct answersE, F
ExplanationThe resolver configuration contains a search domain but no nameserver, so DNS queries have no server to contact. Adding DNS1=8.8.8.8 to the interface configuration gives NetworkManager a persistent DNS setting for eth0. Restarting NetworkManager then reloads that interface configuration and generates an active resolver configuration containing the nameserver.
Question 11
Single choice
A systems administrator is configuring new Linux systems and needs to enable passwordless authentication between two of the servers. Which of the following commands should the administrator use?
-
A
ssh-keygen -t rsa && ssh-copy-id -i ~/.ssh/id_rsa.pub john@server2
-
B
ssh-keyscan -t rsa && ssh-copy-id john@server2 -i ~/.ssh/key
-
C
ssh-agent -i rsa && ssh-copy-id ~/.ssh/key john@server2
-
D
ssh-add -t rsa && scp -rp ~/.ssh john@server2
Reveal answer details
Close answer details
Correct answerA
Explanationssh-keygen -t rsa creates the user's private and public RSA key pair. ssh-copy-id -i ~/.ssh/id_rsa.pub john@server2 then installs the public key for the remote account, allowing that server to authenticate possession of the corresponding private key. This establishes passwordless SSH without copying the private key.
Question 12
Single choice
Which of the following describes what Ansible is used for in the context of IT infrastructure?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerB
ExplanationAnsible is used for configuration management by expressing desired changes and applying them consistently across managed systems. It can automate repeated configuration tasks, package changes, file deployment, and service state. That role is distinct from directly managing databases, process tables, or an inventory of physical assets.
Question 13
Single choice
An administrator needs to install an Apache web server on an Ubuntu server. Which of the following commands should the administrator use?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerB
ExplanationUbuntu uses the APT package-management family, and its Apache HTTP server package is named apache2. Running apt install apache2 resolves the package and installs it through the configured Ubuntu repositories. zypper belongs to a different distribution family, yum commonly installs the package named httpd elsewhere, and rpm cannot install a Debian package directly.
Question 14
Single choice
A Linux administrator wants to display a list of all containers, including ones that are stopped. Which of the following commands should the administrator run?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerA
Explanationdocker ps lists containers, and the -a option expands the result from only running containers to all containers, including stopped ones. Thus docker ps -a provides the required complete container list. Image listing and statistics commands report different Docker objects or runtime information.
Question 15
Single choice
A systems administrator reviews the package management history and sees the following entries: 46 install httpd Install 9 47 update -y Upgrade 44 Which of the following commands should the administrator use to undo the installation of the httpd package from transaction 46?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerB
Explanationyum records package operations as numbered history transactions. yum history undo 46 requests the inverse of transaction 46, which installed httpd, so yum removes the package changes associated with that installation. Referring to the transaction preserves the connection to the recorded action instead of issuing an unrelated package or rollback command.
Question 16
Single choice
A Linux administrator needs to change the server name to comptia1. Which of the following commands should the administrator use?
-
A
-
B
echo " comptia1 " > > /etc/resolv.conf
-
C
hostnamectl set-hostname comptia1
-
D
systemctl daemon-reload -H comptia1
Reveal answer details
Close answer details
Correct answerC
Explanationhostnamectl set-hostname comptia1 uses the system hostname management interface to set the server's hostname persistently. It updates the hostname recognized by the running system and subsequent boots. Exporting HOSTNAME only changes a shell environment value, while resolv.conf and systemctl daemon-reload do not perform hostname configuration.
Question 17
Single choice
A systems administrator is compressing old log files in order to save space. Which of the following commands will allow the administrator to save the most space?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerB
Explanationxz is designed for high compression ratios and generally produces smaller compressed output than gzip or bzip2 for the same compressible log data, although it may require more processing time. Because the stated priority is saving the most storage space, its compression ratio is the decisive property. tar primarily combines files into an archive and does not itself select the strongest compression.
Question 18
Single choice
In the echo "profile-$num-$name" line of a shell script, the variable $num seems to not be expanding during execution. Which of the following notations ensures the value is expanded?
-
A
echo "profile-$(num)-$name"
-
B
echo 'profile-$num-$name'
-
C
echo "profile-'$num'-$name"
-
D
echo "profile-${num}-$name"
Reveal answer details
Close answer details
Correct answerD
ExplanationBraces explicitly delimit a shell variable name, so echo "profile-${num}-$name" expands num before joining its value with the surrounding profile text and the expanded name. Single quotes would suppress expansion, while $(num) requests command substitution instead of reading a variable.
Question 19
Single choice
A Linux administrator needs to check the content of a log file that is appending data as the file grows. Which of the following commands should the administrator use to accomplish this task?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerA
Explanationtail -f log.txt prints the end of log.txt and continues following the file as new data is appended. This keeps the command active and displays additional log entries as they arrive. Running tail without follow mode produces a one-time view, while the other listed flags do not continuously monitor growth.
Question 20
Single choice
A Linux administrator updates the DNS record for the company using: cat /etc/bind/db.abc.com The revised partial zone file is as follows: ns1 IN A 192.168.40.251 ns2 IN A 192.168.40.252 www IN A 192.168.30.30 When the administrator attempts to resolve www.abc.com to its IP address, the domain name still points to its old IP mapping: nslookup www.abc.com Server: 192.168.40.251 Address: 192.168.40.251#53 Non-authoritative answer: Name: www.abc.com Address: 199.168.20.81 Which of the following should the administrator execute to retrieve the updated IP mapping?
-
A
systemd-resolve query www.abc.com
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerD
ExplanationThe zone data contains the new address, but the lookup still returns the old mapping, indicating that a cached DNS response is being reused. resolvectl flush-caches clears locally cached resolver entries. The next lookup must request the record again and can retrieve the updated IP mapping instead of serving the stale value.
Question 21
Single choice
A systems administrator receives a report about performance issues in a Linux production system. Which of the following commands should the administrator use to help diagnose the performance issues?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerC
ExplanationThe top command continuously displays system activity, including CPU use, memory consumption, load, and resource usage by individual processes. Those live measurements help identify which resource or process is causing production slowness. jobs, renice, and pkill manage processes but do not provide a broad performance view.
Question 22
Single choice
A systems administrator is working on configuration changes and needs to replace a hostname in a specific file. Which of the following commands should the administrator use to complete this task?
-
A
cut -d oldhostname /etc/configuration.file | vi newhostname
-
B
sed -i ' s/oldhostname/newhostname/ ' /etc/configuration.file
-
C
cat /etc/configuration.file | grep oldhostname > newhostname
-
D
grep oldhostname /etc/configuration.file | awk ' {print $1 newhostname} '
Reveal answer details
Close answer details
Correct answerB
Explanationsed performs pattern substitution, and s/oldhostname/newhostname/ replaces the old hostname with the new one on matching lines. The -i option writes the change directly to /etc/configuration.file, making the replacement persistent. The other pipelines search, split, or redirect text without correctly editing the original file in place.
Question 23
Single choice
Which of the following is a reason multiple password changes on the same day are not allowed?
-
A
To avoid brute-forced password attacks by making them too long to perform
-
B
To increase password complexity and the system's security
-
C
To stop users from circulating through the password history to return to the originally used password
-
D
To enforce using multifactor authentication with stronger encryption algorithms instead of passwords
Reveal answer details
Close answer details
Correct answerC
ExplanationA minimum interval between password changes prevents a user from rapidly cycling through several new passwords in one day. Without that delay, the user could consume the password-history entries and then return to the original password. The restriction therefore preserves the effectiveness of password reuse history.
Question 24
Single choice
An administrator receives a report that a user is unable to execute the runreports utility. The administrator logs in as the user, runs the following commands, and receives the following output: $ runreports
runreports: command not found
$ ls -l /usr/local/bin
-rwxr-xr-x 1 root root 29 May 10 11:31 runreports
$ echo $PATH
/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin Which of the following best describes the issue and how to resolve it?
-
A
The runreports utility is not in the user ' s path. The administrator should modify the .bash_profile file.
-
B
The runreports utility is a shell script but not owned by the user. The administrator should use chown.
-
C
The user does not have the correct SELinux context. The administrator should modify the SELinux template.
-
D
The runreports utility does not have execute permissions. The administrator should add execute permissions.
Reveal answer details
Close answer details
Correct answerA
ExplanationThe listing confirms that runreports exists in /usr/local/bin and already has execute permission for the owner, group, and others. However, /usr/local/bin is absent from the user's PATH, so entering only runreports cannot locate it. Adding that directory to PATH in .bash_profile makes the utility discoverable in future login shells.
Question 25
Single choice
Which of the following is the location for built-in Linux executable files and utilities?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerA
Explanation/bin is the conventional location for essential executable commands and utilities needed for basic system operation. Its name reflects its role as a binary-program directory. By contrast, /etc contains system configuration, /var holds changing data such as logs and queues, and /sys exposes kernel and device information through a virtual filesystem.
Question 26
Single choice
Which of the following commands can be used to display real-time running processes on a Linux system?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerB
Explanationtop provides a continuously refreshed display of running processes. It updates process states and resource metrics such as CPU and memory usage in real time, allowing activity to be monitored as it changes. ps normally produces a point-in-time process listing, while df and free report filesystem and memory information rather than a live process view.
Question 27
Single choice
A systems administrator needs to check the statuses of all the services on a Linux server. Which of the following commands accomplishes this task?
-
A
systemctl is-active --services
-
B
systemctl list-sockets --type=services
-
C
systemctl is-enabled --services
-
D
systemctl list-units --type=services
Reveal answer details
Close answer details
Correct answerD
Explanationsystemctl list-units --type=service displays service units currently known to systemd along with their load, active, and sub states, allowing an administrator to review service status. is-active and is-enabled are primarily used to check the runtime or enablement state of specified units, while list-sockets displays socket units rather than services.
Question 28
Single choice
A systems administrator needs to set the IP address of a new DNS server. Which of the following files should the administrator modify to complete this task?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerB
Explanation/etc/resolv.conf contains resolver settings, including nameserver entries that identify the IP addresses of DNS servers. Updating the appropriate nameserver entry directs hostname lookups to the new DNS server. The other files serve different naming, lookup-order, or DNS service configuration purposes.
Question 29
Single choice
When trying to connect from the bastion host to the remote server, a Linux user always forgets to add some required options in the SSH command line. Which of the following is the best way to permanently solve the user's issue?
-
A
Write a connection script and put it in the user's home directory.
-
B
Instruct the user to add the required options to the ~/.ssh/config file
-
C
Add the required options to /etc/ssh/sshconfig
-
D
Establish an alias for the SSH command with all the required options.
Reveal answer details
Close answer details
Correct answerB
ExplanationThe per-user ~/.ssh/config file stores persistent SSH client settings by host, such as usernames, ports, keys, and other connection options. Once the required values are placed in the matching host entry, the SSH client applies them automatically. This directly prevents repeated omissions without changing settings for every system user.
Question 30
Single choice
A Linux systems administrator is running an important maintenance task that consumes a large amount of CPU, causing other applications to slow. Which of the following actions should the administrator take to help alleviate the issue?
-
A
Increase the available CPU time with pidstat.
-
B
Lower the priority of the maintenance task with renice.
-
C
Run the maintenance task with nohup.
-
D
Execute the other applications with the bg utility.
Reveal answer details
Close answer details
Correct answerB
ExplanationThe maintenance process is consuming CPU time that other applications need. Using renice to lower its scheduling priority causes the scheduler to favor higher-priority application processes when CPU time is contested. pidstat only reports activity, while nohup and bg change how a command runs relative to a terminal without reducing its CPU scheduling priority.
Question 31
Single choice
Which of the following most accurately describes a webhook?
-
A
An authentication method for web-server communication
-
B
An SNMP-based API for network device monitoring
-
C
A means to transmit sensitive information between systems
-
D
An HTTP-based callback function
Reveal answer details
Close answer details
Correct answerD
ExplanationA webhook is an HTTP-based callback function used to notify another endpoint when an event occurs. The originating system sends an HTTP request to a configured URL, allowing the receiving system to react without repeatedly polling for changes. The term describes this event-driven callback mechanism, not an authentication method or SNMP monitoring interface.
Question 32
Single choice
An administrator needs to create a new logical volume from sets of provisioned disks. Which of the following shows the correct order of commands the administrator should execute?
-
A
1. pvcreate, 2. vgcreate, 3. lvcreate
-
B
1. vgcreate, 2. pvcreate, 3. lvcreate
-
C
1. vgcreate, 2. lvcreate, 3. pvcreate
-
D
1. lvcreate, 2. pvcreate, 3. vgcreate
Reveal answer details
Close answer details
Correct answerA
ExplanationLVM objects must be built from the storage layer upward. First, pvcreate initializes the provisioned disks as physical volumes. Second, vgcreate combines those physical volumes into a volume group that supplies pooled capacity. Third, lvcreate allocates the requested logical volume from that volume group, so the required order is 1. pvcreate, 2. vgcreate, 3. lvcreate.
Question 33
Single choice
Which of the following Git commands would send committed changes to a remote repository?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerC
ExplanationA commit exists only in the local repository until it is transmitted to a remote. git push origin master sends the local master branch's committed changes to the remote named origin. git add stages working-tree changes, git commit records them locally, and git stash temporarily stores uncommitted work; none of those operations publishes commits to the remote repository.
Question 34
Single choice
A systems administrator is writing a script to analyze the number of files in the directory /opt/application / home/. Which of the following commands should the administrator use in conjunction with ls -l | to count the files?
-
A
-
B
-
C
-
D
Reveal answer details
Close answer details
Correct answerD
Explanationwc -l counts newline-terminated records received through standard input. When placed after ls -l |, it counts the lines produced by the directory listing, providing the script with a numeric count of listed entries. The other commands display, follow, or translate input rather than reporting its line count.
|