Practice Free XK0-005 Exam Online Questions
An administrator needs to increase the system priority of a process with PID 2274.
Which of the following commands should the administrator use to accomplish this task?
- A . renice ―n ―15 2274
- B . nice -15 2274
- C . echo "―15" > /proc/PID/2274/priority
- D . ps ―ef I grep 2274
A
Explanation:
The renice command is used to change the priority of a running process by specifying its PID and the new nice value. The -n flag indicates the amount of change in the nice value, which can be positive or negative. A lower nice value means a higher priority, so -15 will increase the priority of the process with PID 2274. The administrator needs to have root privileges to do this.
Reference: The renice command is listed as one of the commands to manipulate process priority in the web search result 1.
The renice command is also explained with examples in the web search result 2.
The CompTIA Linux+ Certification Exam Objectives mention that the candidate should be able to “manage process execution priorities” as part of the System Operation and Maintenance domain1.
Users have been unable to reach www.comptia.org from a Linux server.
A systems administrator is troubleshooting the issue and does the following:
Based on the information above, which of the following is causing the issue?
- A . The name www.comptia.org does not point to a valid IP address.
- B . The server 192.168.168.53 is unreachable.
- C . No default route is set on the server.
- D . The network interface eth0 is disconnected.
B
Explanation:
The issue is caused by the server 192.168.168.53 being unreachable. This server is the DNS server configured in the /etc/resolv.conf file, which is used to resolve domain names to IP addresses. The ping command shows that the server cannot be reached, and the nslookup command shows that the name www.comptia.org cannot be resolved using this server.
The other options are incorrect because:
The name www.comptia.org does point to a valid IP address, as shown by the nslookup command using another DNS server (8.8.8.8).
The default route is set on the server, as shown by the ip route command, which shows a default gateway of 192.168.168.1.
The network interface eth0 is connected, as shown by the ip link command, which shows a state of UP for eth0.
Reference: CompTIA Linux+ Study Guide, Fourth Edition, page 457-458, 461-462.
A new Linux systems administrator just generated a pair of SSH keys that should allow connection to the servers.
Which of the following commands can be used to copy a key file to remote servers? (Choose two.)
- A . wget
- B . ssh-keygen
- C . ssh-keyscan
- D . ssh-copy-id
- E . ftpd
- F . scp
D,F
Explanation:
The commands ssh-copy-id and scp can be used to copy a key file to remote servers. The command ssh-copy-id copies the public key to the authorized_keys file on the remote server, which allows the user to log in without a password. The command scp copies files securely over SSH, which can be used to transfer the key file to any location on the remote server. The other options are incorrect because they are not related to copying key files. The command wget downloads files from the web, the command ssh-keygen generates key pairs, the command ssh-keyscan collects public keys from remote hosts, and the command ftpd is a FTP server daemon.
Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 13: Managing Network Services, pages 408-410.
A Linux administrator is adding a new configuration file to a Git repository.
Which of the following describes the correct order of Git commands to accomplish the task successfully?
- A . pull -> push -> add -> checkout
- B . pull -> add -> commit -> push
- C . checkout -> push -> add -> pull
- D . pull -> add -> push -> commit
B
Explanation:
The correct order of Git commands to add a new configuration file to a Git repository is pull -> add -> commit -> push. The pull command will fetch and merge the changes from the remote repository to the local repository, ensuring that the local repository is up to date. The add command will stage the new configuration file for the next commit, marking it as a new file to be tracked by Git. The commit command will create a new snapshot of the project state with the new configuration file and a descriptive message. The push command will publish the commit to the remote repository, updating the remote branch with the new configuration file. The pull -> push -> add -> checkout order is incorrect, as it will not create a commit for the new configuration file, and it will switch to a different branch without pushing the changes. The checkout -> push -> add -> pull order is incorrect, as it will switch to a different branch before adding the new configuration file, and it will overwrite the local changes with the remote changes without creating a commit. The pull -> add -> push -> commit order is incorrect, as it will not create a commit before pushing the changes, and it will create a commit that is not synchronized with the remote branch.
Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 20: Writing and Executing Bash Shell Scripts, page 579.
The group named support is unable to make changes to the config file.
An administrator is reviewing the permissions and sees the following:
S Is -1 config -rw-rw—-. 1 root app 4682 02-15 11:25 config
Which of the following should the administrator execute in order to give the support group access to modify the file while preserving the current ownership?
- A . chown :support config
- B . setfacl -m g:support:rw- config
- C . chmod 664 config
- D . chmod g+s config
C
Explanation:
To give the support group access to modify the config file while preserving the current ownership, the administrator can execute the command chmod 664 config ©. This will change the permissions of the config file to read and write for the owner and group, and read only for others. The owner and group of the file will remain as root and app respectively. The other commands will not achieve this task, but either change the group ownership, set an access control list, or set a setgid bit.
Reference: [CompTIA Linux+ Study Guide], Chapter 3: Working with Files, Section: Changing File Permissions [How to Use chmod Command in Linux]
An administrator wants to execute a long-running script in the terminal while troubleshooting another issue.
Which of the following options will achieve this goal?
- A . bash script.sh &
- B . source script.sh
- C . sh script.sh | jobs
- D . nice -10 ./script.sh
A
Explanation:
Running a command with & at the end sends it to the background, allowing the administrator to continue using the terminal for other tasks while the script runs. This is useful for long-running scripts that do not require immediate attention but need to keep running.
Reference: Linux Background Jobs
A cloud engineer needs to block the IP address 192.168.10.50 from accessing a Linux server.
Which of the following commands will achieve this goal?
- A . iptables -F INPUT -j 192.168.10.50 -m DROP
- B . iptables -A INPUT -s 192.168.10.30 -j DROP
- C . iptables -i INPUT –ipv4 192.168.10.50 -z DROP
- D . iptables -j INPUT 192.168.10.50 -p DROP
B
Explanation:
The correct command to block the IP address 192.168.10.50 from accessing a Linux server is iptables -A INPUT -s 192.168.10.50 -j DROP. This command appends a rule to the INPUT chain that matches the source address 192.168.10.50 and jumps to the DROP target, which discards the packet. The other commands are incorrect because they either have invalid syntax, wrong parameters, or wrong order of arguments.
Reference: CompTIA Linux+ Study Guide, Fourth Edition, page 457-458.
Which of the following command sequences is used to install Linux software directly from source code?
- A . ./config → ./compile → ./copy
- B . unzip → gcc → install
- C . ./unpack → make exec → make copy
- D . ./configure → make → make install
A systems administrator is reviewing the following output on the text editor that is being used to update the company’s internal database records:
Which of the following extensions should the systems administrator use when saving the file?
- A . .json
- B . .yaml
- C . .tf
- D . .sh
Users are reporting that a Linux server is responding slowly. A systems administrator troubleshooting the server issue sees the following iostat output, with %iowait at 50.38.
Which of the following is most likely the issue?
- A . The CPU is mostly waiting for I/O operations.
- B . / filesystem does not have enough storage allocated.
- C . /var filesystem is almost full.
- D . The CPU capacity is inadequate.
A
Explanation:
The %iowait value represents the percentage of time the CPU is waiting for I/O operations to complete. A high %iowait value suggests the system is bottlenecked by disk I/O, which could lead to slow response times. Addressing disk I/O bottlenecks would improve performance.
Reference: Linux Performance Monitoring with iostat