[2025年03月31日]XK0-005試験問題集でリアル試験と100%同じ問題と解答
XK0-005テストエンジン問題集トレーニングには390問あります
CompTIA XK0-005 試験は、Linux システム管理に関連する様々なトピックをカバーする包括的な試験です。この試験は、複数選択問題とパフォーマンスベースの問題から構成され、候補者の実践的なスキルをテストします。この試験は、基本的な Linux コマンド、システム管理、セキュリティ、ネットワークに関する候補者の知識をテストするために設計されています。この試験に合格した候補者は、クラウド、サーバー、モバイルデバイスなど、異なる環境で Linux システムを管理する能力を証明します。この認定は 3 年間有効であり、候補者は認定ステータスを維持するために再認定する必要があります。
質問 # 142
A Linux administrator copied a Git repository locally, created a feature branch, and committed some changes to the feature branch. Which of the following Git actions should the Linux administrator use to publish the changes to the main branch of the remote repository?
- A. tag
- B. rebase
- C. push
- D. commit
正解:D
質問 # 143
A systems administrator is creating new user accounts on several Linux machines and wants to automate the process from a Linux system used for operations. In this operations system, the list of servers is located in the /home/user/serverslist file and the list of user accounts is located in the
/home/user/userslist file. Which of the following scripts will help accomplish this task?
- A. bash
ssh user@$(cat /home/user/serverslist) "sudo useradd $(cat /home/user/userslist); exit" - B. bash
for server in $(cat /home/user/serverslist)
do
ssh -i user@$server "for user in $(cat /home/user/userslist) do sudo useradd $user done; exit" done - C. bash
for server in $(cat /home/user/serverslist)
do
for user in $(cat /home/user/userslist)
do
sudo useradd $user
done
done - D. bash
for server in $(cat /home/user/serverslist)
do
scp /home/user/userslist user@$server:/tmp
ssh -i user@$server "for user in $(cat /tmp/userslist) do sudo useradd $user done; exit" done
正解:B
解説:
The script in option B performs the task by SSH-ing into each server listed in serverslist and then adding each user listed in userslist. This is an effective way to remotely create user accounts without manually logging into each server. The ssh command allows the execution of the useradd commands on the remote machines.
質問 # 144
A network administrator issues the dig www.comptia.org command and receives an NXDOMAIN response.
Which of the following files should the administrator check first?
- A. /etc/hosts
- B. /etc/sysconfig/network-scripts
- C. /etc/resolv.conf
- D. /etc/nsswitch.conf
正解:C
解説:
Step-by-Step Comprehensive Detailed Explanation:
* Command Explanation:
* The dig command queries DNS servers. If NXDOMAIN is received, the system cannot resolve the domain. The /etc/resolv.conf file contains the DNS server configuration.
* Why Other Options are Incorrect:
* B: /etc/hosts maps IP addresses to hostnames but is not queried unless configured in /etc/nsswitch.
conf.
* C: /etc/sysconfig/network-scripts contains network interface configurations, unrelated to DNS.
* D: /etc/nsswitch.conf defines the order of name resolution methods, but it does not directly resolve domain names.
* References:
* CompTIA Linux+ Study Guide: Network Configuration
* man dig
質問 # 145
A systems administrator is enabling LUKS on a USB storage device with an ext4 filesystem format. The administrator runs dmesg and notices the following output:
Given this scenario, which of the following should the administrator perform to meet these requirements? (Choose three.)
- A. mkfs.vfat /dev/mapper/LUKS0001 - L ENCRYPTED
- B. mkfs.ext4 /dev/mapper/LUKS0001 - L ENCRYPTED
- C. pvcreate /dev/sdc
- D. umount /dev/sdc
- E. gpg /dev/sdc1
- F. cryptsetup luksFormat /dev/sdc1
- G. wipefs -a/dev/sdb1
- H. fdisk /dev/sdc
正解:B、D、F
解説:
To enable LUKS on a USB storage device with an ext4 filesystem format, the administrator needs to perform the following steps:
Unmount the device if it is mounted using umount /dev/sdc (D) Create a partition table on the device using fdisk /dev/sdc (E) Format the partition with LUKS encryption using cryptsetup luksFormat /dev/sdc1 (H) Open the encrypted partition using cryptsetup luksOpen /dev/sdc1 LUKS0001 Create an ext4 filesystem on the encrypted partition using mkfs.ext4
/dev/mapper/LUKS0001
Mount the encrypted partition using mount /dev/mapper/LUKS0001 /mnt
質問 # 146
A Linux administrator was notified that a virtual server has an I/O bottleneck. The Linux administrator analyzes the following output:
Given there is a single CPU in the sever, which of the following is causing the slowness?
- A. The memory is exhausted.
- B. The processes are paging.
- C. The system is running out of swap space.
- D. The CPU is overloaded.
正解:D
解説:
Explanation
The slowness is caused by the CPU being overloaded. The iostat command shows that the CPU utilization is
100%, which means that there are more processes competing for CPU time than the CPU can handle. The other options are incorrect because:
The system is not running out of swap space, as shown by the iostat command, which shows that there is no swap activity (si and so columns are zero).
The memory is not exhausted, as shown by the free -m command, which shows that there is still available memory (avail column) and free buffer/cache memory (buff/cache column).
The processes are not paging, as shown by the vmstat command, which shows that there are no major page faults (majflt column) and no swap activity (si and so columns). References: CompTIA Linux+ Study Guide, Fourth Edition, page 417-419, 424-425.
質問 # 147
A systems administrator is gathering information about a file type and the contents of a file. Which of the following commands should the administrator use to accomplish this task?
- A. file filename
- B. lsof filename
- C. grep filename
- D. touch filename
正解:A
解説:
The file command is used to determine the type of a file by examining its contents. It can recognize many different formats, such as text, binary, executable, compressed, image, audio, video, etc. It can also display some additional information about the file, such as encoding, size, dimensions, etc.
質問 # 148
An administrator deployed a Linux server that is running a web application on port 6379/tcp.
SELinux is in enforcing mode based on organization policies.
The port is open on the firewall.
Users who are trying to connect to a local instance of the web application receive Error 13, Permission denied.
The administrator ran some commands that resulted in the following output:
Which of the following commands should be used to resolve the issue?
- A. semanage port -a http_port_t -p top 6379
- B. semanage port -a -t http_port_t -p tcp 6379
- C. semanage port -d -t http_port_t -p tcp 6379
- D. semanage port -l -t http_port_tcp 6379
正解:B
解説:
The command semanage port -a -t http_port_t -p tcp 6379 adds a new port definition to the SELinux policy and assigns the type http_port_t to the port 6379/tcp. This allows the web application to run on this port and accept connections from users. This is the correct way to resolve the issue. The other options are incorrect because they either delete a port definition (-d), use the wrong protocol (top instead of tcp), or list the existing port definitions (-l). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 18:
Securing Linux Systems, page 535.
質問 # 149
The dracutcommand is used to:
- A. compile the Linux kernel images used to boot the OS.
- B. create the bootloader executable files.
- C. create initial RAMDisk images for preloading modules.
- D. create the Boot Manager configuration files.
正解:C
質問 # 150
While troubleshooting server issues, a Linux systems administrator obtains the following output:
[rootGhost ~]# total free -m used free shared buf f/cache available
Mem: 3736 3598 88 2 48 29
Swap: 2047 1824 223
Which of the following best describes the state of the system?
- A. The system has allocated enough buffer space.
- B. The system has swap disabled.
- C. The system has consumed the system memory and swap space.
- D. The system has enough free memory space.
正解:D
解説:
The output shows that the system has a total of 3736MB of memory, of which 3598MB is free. This indicates that the system has enough free memory space12.
Reference:
1(https://phoenixnap.com/kb/swap-space)
2(https://www.baeldung.com/linux/swap-space-use)
質問 # 151
A systems administrator needs to check if the service systemd-resolved.service is running without any errors. Which of the following commands will show this information?
- A. systemct1 enable systemd-resolved.service
- B. systemct1 status systemd-resolved.service
- C. systemct1 mask systemd-resolved.service
- D. systemct1 show systemd-resolved.service
正解:B
解説:
The command systemct1 status systemd-resolved.service will show the information about the service systemd-resolved.service. The systemct1 command is a tool for managing system services and units. The status option displays the current status of a unit, such as active, inactive, or failed. The output also shows the unit description, loaded configuration, process ID, memory usage, and recent log messages. This command will show if the service systemd-resolved.service is running without any errors. This is the correct command to use to accomplish the task. The other options are incorrect because they either perform different actions (enable, mask, or show) or do not show the status of the service (systemct1 show systemd-resolved.service only shows the properties of the service, not the status). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 14: Managing Processes and Scheduling Tasks, page 427.
質問 # 152
A Linux administrator would like to use systemd to schedule a job to run every two hours. The administrator creates timer and service definitions and restarts the server to load these new configurations. After the restart, the administrator checks the log file and notices that the job is only running daily. Which of the following is MOST likely causing the issue?
- A. The checkdiskspace.service needs to be enabled.
- B. The OnCalendar schedule is incorrect in the timer definition.
- C. The checkdiskspace.service is not running.
- D. The system-daemon services need to be reloaded.
正解:B
解説:
The OnCalendar schedule is incorrect in the timer definition, which is causing the issue. The OnCalendar schedule defines when the timer should trigger the service. The format of the schedule is OnCalendar=<year>-<month>-<day> <hour>:<minute>:<second>. If any of the fields are omitted, they are assumed to be *, which means any value. Therefore, the schedule OnCalendar=*-*-*
00:00:00 means every day at midnight, which is why the job is running daily. To make the job run every two hours, the schedule should be OnCalendar=*-*-* *:00:00/2, which means every hour divisible by 2 at the start of the minute. The other options are incorrect because they are not related to the schedule. The checkdiskspace.service is running, as shown by the output of systemct1 status checkdiskspace.service. The checkdiskspace.service is enabled, as shown by the output of systemct1 is-enabled checkdiskspace.service. The system-daemon services do not need to be reloaded, as the timer and service definitions are already loaded by the restart.
質問 # 153
A file called testfile has both uppercase and lowercase letters:
$ cat testfile
ABCDEfgH
IJKLmnoPQ
abcdefgH
ijklLMNopq
A Linux administrator is tasked with converting testfile into all uppercase and writing it to a new file with the name uppercase. Which of the following commands will achieve this task?
- A. tr '(A-Z}' '{a-z}' < testfile > uppercase
- B. cat testfile | tr '{z-a)' '{Z-A}' < testfile > uppercase
- C. tr '[a-z]' '[A-Z]' < testfile > uppercase
- D. echo testfile | tr "[Z-A]" "[z-a]" < testfile > uppercase
正解:C
解説:
Explanation
This command will use the tr tool to translate all lowercase letters in the testfile to uppercase letters and write the output to the uppercase file. The first argument '[a-z]' specifies the set of characters to be replaced, and the second argument '[A-Z]' specifies the set of characters to replace with. The '<' symbol redirects the input from the testfile, and the '>' symbol redirects the output to the uppercase file12.
References: 1: Linux Tr Command - javatpoint 2: Linux tr Command with Examples - phoenixNAP
質問 # 154
Employees in the finance department are having trouble accessing the file /opt/work/file. All IT employees can read and write the file. Systems administrator reviews the following output:
Which of the following commands would permanently fix the access issue while limiting access to IT and finance department employees?
- A. chattr +i file
- B. chown it:finance file
- C. setfacl -m g:finance:rw file
- D. chmod 666 file
正解:C
解説:
The command setfacl -m g:finance:rw file will permanently fix the access issue while limiting access to IT and finance department employees. The setfacl command is a tool for modifying the access control lists (ACLs) of files and directories on Linux systems. The ACLs are a mechanism that allows more fine-grained control over the permissions of files and directories than the traditional owner- group-others model. The -m option specifies the modification to the ACL. The g:finance:rw means that the group named finance will have read and write permissions on the file.
The file is the name of the file to modify, in this case /opt/work/file. The command setfacl -m g:finance:rw file will add an entry to the ACL of the file that will grant read and write access to the finance group. This will fix the access issue and allow the finance employees to access the file.
The command will also preserve the existing permissions of the file, which means that the IT employees will still have read and write access to the file. This will limit the access to IT and finance department employees and prevent unauthorized access from other users.
質問 # 155
A Linux administrator needs to run a few virtual machines and containers on the physical machines with a single network interface.
Which of the following networking would allow the administrator to connect with the outside world?
- A. VLAN
- B. Bonding/teaming
- C. VPN
- D. Bridging
正解:D
質問 # 156
A Linux engineer has been notified about the possible deletion of logs from the file /opt/app/logs. The engineer needs to ensure the log file can only be written into without removing previous entries.
Which of the following commands would be BEST to use to accomplish this task?
- A. chattr +c /opt/app/logs
- B. chattr +d /opt/app/logs
- C. chattr +i /opt/app/logs
- D. chattr +a /opt/app/logs
正解:D
解説:
The command chattr +a /opt/app/logs will ensure the log file can only be written into without removing previous entries. The chattr command is a tool for changing file attributes on Linux file systems.
The +a option sets the append-only attribute, which means that the file can only be opened in append mode for writing. This prevents the file from being modified, deleted, or renamed. This is the best command to use to accomplish the task. The other options are incorrect because they either set the wrong attributes (+d, +i, or +c) or do not affect the file at all (-a). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 11: Managing Files and Directories, page 357.
質問 # 157
User1 is a member of the accounting group. Members of this group need to be able to execute but not make changes to a script maintained by User2. The script should not be accessible to other users or groups. Which of the following will give proper access to the script?
- A. chown user2:accounting script.sh
chmod 750 script.sh - B. chown accounting:user1 script.sh
chmod 057 script.sh - C. chown user2:accounting script.sh
chmod u+x script.sh - D. chown user1:accounting script.sh
chmod 777 script.sh
正解:A
解説:
The commands that will give proper access to the script are:
chown user2:accounting script.sh: This command will change the ownership of the script to user2 as the owner and accounting as the group. The chown command is a tool for changing the owner and group of files and directories on Linux systems. The user2:accounting is the user and group name that the command should assign to the script. The script.sh is the name of the script that the command should modify. The command chown user2:accounting script.sh will ensure that user2 is the owner of the script and accounting is the group of the script, which will allow user2 to maintain the script and the accounting group to access the script.
chmod 750 script.sh: This command will change the permissions of the script to 750, which means read, write, and execute for the owner; read and execute for the group; and no access for others. The chmod command is a tool for changing the permissions of files and directories on Linux systems. The permissions are represented by three digits in octal notation, where each digit corresponds to the owner, group, and others. Each digit can have a value from 0 to 7, where each value represents a combination of read, write, and execute permissions. The 750 is the permission value that the command should assign to the script. The script.sh is the name of the script that the command should modify. The command chmod 750 script.sh will ensure that only the owner and the group can execute the script, but not make changes to it, and that the script is not accessible to other users or groups.
The commands that will give proper access to the script are chown user2:accounting script.sh and chmod 750 script.sh. This is the correct answer to the question. The other options are incorrect because they either do not give proper access to the script (chown user1:accounting script.sh or chown accounting:user1 script.sh) or do not change the permissions of the script (chmod 777 script.sh or chmod u+x script.sh). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 11: Managing File Permissions and Ownership, pages 346-348.
質問 # 158
A cloud engineer is asked to copy the file deployment.yaml from a container to the host where the container is running. Which of the following commands can accomplish this task?
- A. docker cp container_id:/deployment.yaml deployment.yaml
- B. docker cp container_id/deployment.yaml local://deployment.yaml
- C. docker cp container_id/deployment.yaml deployment.yaml
- D. docker cp deployment.yaml local://deployment.yaml
正解:C
質問 # 159
When a technician plugs a USB flash drive into a server, the drive does not mount automatically.
Which of the following commands will provide the information needed to mount the drive manually?
- A. modinfo
- B. lshw
- C. mount
- D. lspci
正解:C
質問 # 160
A Linux administrator is troubleshooting the root cause of a high CPU load and average.
Which of the following commands will permanently resolve the issue?
- A. kill -9 6295
- B. pstree -p 6295
- C. iostat -cy 1 5
- D. renice -n -20 6295
正解:A
解説:
Explanation
The command that will permanently resolve the issue of high CPU load and average is kill -9 6295. This command will send a SIGKILL signal to the process with the PID 6295, which is the process that is consuming 99.7% of the CPU according to the top output. The SIGKILL signal will terminate the process immediately and free up the CPU resources. The kill command is used to send signals to processes by PID or name.
The other options are not correct commands for resolving this issue. The renice -n -20 6295 command will change the priority (niceness) of the process with PID 6295 to -20, which is the highest priority possible. This will make the process more CPU-intensive, not less. The renice command is used to change the priority of running processes. The pstree -p 6295 command will show a tree of processes with PID 6295 as the root. This will not affect the CPU load or average, but only display information. The pstree command is used to display a tree of processes. The iostat -cy 1 5 command will show CPU and disk I/O statistics for 5 iterations with an interval of 1 second. This will also not affect the CPU load or average, but only display information. The iostat command is used to report CPU and I/O statistics. References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 11: Troubleshooting Linux Systems; kill(1) - Linux manual page; renice(1) - Linux manual page; pstree(1) - Linux manual page; iostat(1) - Linux manual page
質問 # 161
A user is asking the systems administrator for assistance with writing a script to verify whether a file exists.
Given the following:
Which of the following commands should replace the <CONDITIONAL> string?
- A. if [ -f "$filename" ]; while
- B. if [ -f "$filename" ] then
- C. if [ -f "$filename" ]; then
- D. if [ -d "$filename" ]; then
正解:C
解説:
Explanation
The command if [ -f "$filename" ]; then checks if the variable $filename refers to a regular file that exists.
The -f option is used to test for files. If the condition is true, the commands after then are executed. This is the correct way to replace the <CONDITIONAL> string. The other options are incorrect because they either use the wrong option (-d tests for directories), the wrong syntax (missing a semicolon after the condition), or the wrong keyword (while is used for loops, not conditions). References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 16: Writing and Executing Bash Shell Scripts, page 493.
質問 # 162
A Linux administrator is trying to remove the ACL from the file /home/user/data. txt but receives the following error message:
Given the following analysis:
Which of the following is causing the error message?
- A. SELinux file context is denying the ACL changes.
- B. The filesystem is mounted with the wrong options.
- C. The administrator is not using a highly privileged account.
- D. File attributes are preventing file modification.
正解:D
解説:
Explanation
File attributes are preventing file modification, which is causing the error message. The output of lsattr
/home/user/data.txt shows that the file has the immutable attribute (i) set, which means that the file cannot be changed, deleted, or renamed. The command setfacl -b /home/user/data.txt tries to remove the ACL from the file, but fails because of the immutable attribute. The administrator needs to remove the immutable attribute first by using the command chattr -i /home/user/data.txt and then try to remove the ACL again. The other options are incorrect because they are not supported by the outputs. The administrator is using a highly privileged account, as shown by the # prompt. The filesystem is mounted with the correct options, as shown by the output of mount | grep /home. SELinux file context is not denying the ACL changes, as shown by the output of ls -Z /home/user/data.txt. References: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 11: Managing Files and Directories, pages 357-358.
質問 # 163
As a Systems Administrator, to reduce disk space, you were tasked to create a shell script that does the following:
Add relevant content to /tmp/script.sh, so that it finds and compresses rotated files in /var/log without recursion.
INSTRUCTIONS
Fill the blanks to build a script that performs the actual compression of rotated log files.
If at any time you would like to bring back the initial state of the simulation, please click the Reset All button.
正解:
解説:

質問 # 164
A development team asks an engineer to guarantee the persistency of journal log files across system reboots. Which of the following commands would accomplish this task?
- A. cat /etc/systemd/journald.conf | awk '(print $1,$3)'
- B. grep -i auto /etc/systemd/journald.conf && systemctl restart systemd-journald.service
- C. journalctl --list-boots && systemctl restart systemd-journald.service
- D. sed -i 's/auto/persistent/g' /etc/systemd/journald.conf && sed -i 'persistent/s/'#//q' /etc/systemd/journald.conf
正解:D
解説:
The command sed -i 's/auto/persistent/g' /etc/systemd/journald.conf && sed -i 'persistent/s/'#//q' /etc/systemd/journald.conf will accomplish the task of guaranteeing the persistency of journal log files across system reboots. The sed command is a tool for editing text files on Linux systems. The -i option modifies the file in place. The s command substitutes one string for another. The g flag replaces all occurrences of the string. The && operator executes the second command only if the first command succeeds. The q command quits after the first match. The /etc/systemd/journald.conf file is a configuration file for the systemd-journald service, which is responsible for collecting and storing log messages. The command sed -i 's/auto/persistent/g' /etc/systemd/journald.conf will replace the word auto with the word persistent in the file. This will change the value of the Storage option, which controls where the journal log files are stored. The value auto means that the journal log files are stored in the volatile memory and are lost after reboot, while the value persistent means that the journal log files are stored in the persistent storage and are preserved across reboots. The command sed -i 'persistent/s/'#//q' /etc/systemd/journald.conf will remove the # character at the beginning of the line that contains the word persistent. This will uncomment the Storage option and enable it. The command sed -i 's/auto/persistent/g' /etc/systemd/journald.conf && sed -i 'persistent/s/'#//q' /etc/systemd/journald.conf will guarantee the persistency of journal log files across system reboots by changing and enabling the Storage option to persistent. This is the correct command to use to accomplish the task. The other options are incorrect because they either do not change the value of the Storage option (grep -i auto /etc/systemd/journald.conf && systemctl restart systemd-journald.service or cat /etc/systemd/journald.conf | awk '(print $1,$3)') or do not enable the Storage option (journalctl --list-boots && systemctl restart systemd-journald.service). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 16: Managing Logging and Monitoring, page 489.
質問 # 165
......
CompTIA XK0-005 認定試験は、Linux システムの管理と運用に関するスキルと知識を検証するための優れた機会です。この認定は、ベンダーに依存しない検証を提供し、潜在的な雇用主により市場価値の高い人材として扱われる可能性を高めることができます。さまざまな産業で Linux プロフェッショナルの需要が高まっている中、この認定は IT プロフェッショナルが自己を差別化し、キャリアを進めるのに役立ちます。
XK0-005練習テストPDF試験材料:https://www.jpntest.com/shiken/XK0-005-mondaishu
XK0-005問題で一発合格させる問題集にはLinux+認定問題を使おう:https://drive.google.com/open?id=1_PgLtAK96gU4TO1EZJiS-D1LvQ1mVRE2