XK0-004 Practice Exam Free – 50 Questions to Simulate the Real Exam
Are you getting ready for the XK0-004 certification? Take your preparation to the next level with our XK0-004 Practice Exam Free – a carefully designed set of 50 realistic exam-style questions to help you evaluate your knowledge and boost your confidence.
Using a XK0-004 practice exam free is one of the best ways to:
- Experience the format and difficulty of the real exam
- Identify your strengths and focus on weak areas
- Improve your test-taking speed and accuracy
Below, you will find 50 realistic XK0-004 practice exam free questions covering key exam topics. Each question reflects the structure and challenge of the actual exam.
An administrator wants to know the amount of memory installed on a Linux server. Which of the following commands can be used to accomplish this task?
A. cat /sys/proc/meminfo
B. cat /proc/meminfo
C. cat /proc/sys/meminfo
D. cat /sys/meminfo
A systems administrator wants to disable the isofs module on the server. Which of the following will allow the administrator to check if the isofs module is currently in use?
A. modprobe
B. insmod
C. rmmod
D. lsmod
An engineer is working on a production application deployment that requires changing a web application property file called server.property that is managed by the Git version control system. A cloned copy of the remote repository in which the server.property file exists is on the local desktop computer. The engineer makes appropriate changes to the files, saves it as server.property, and executes git commit `"m `changed the property file` server.property. Which of the following commands did the engineer fail to perform?
A. git init server.property
B. git merge server.property
C. git add server.property
D. git push server.property
A systems administrator has set up third-party log aggregation agents across several cloud instances. The systems administrator wants to create a dashboard of failed SSH attempts and the usernames used. Which of the following files should be watched by the agents?
A. /var/log/audit/audit.log
B. /var/log/kern.log
C. /var/log/monitor
D. /etc/rsyslog.conf
A systems administrator wants to increase the existing drive space on a Linux server with a software RAID. After physically adding the new drive to the system, and then adding the drive to the RAID array, the administrator notices the available drive space has not increased. A status of the array shows the new drive and the original storage space: md0 : active Raid sdd1[3]S sdc1[2] sdb1[1] sda1[0] 954585654 blocks level5 64K chunk algorithm 2 [3/3] [UUU] Which of the following should the administrator do to make all storage space available on the RAID array?
A. Run hdparm to alert the kernel to a new drive.
B. Convert the new drive to a hot spare.
C. Set the RAID type to a RAID 1.
D. Grow the array size to four members.
A company's httpd server has stopped working and restarting the service does not fix the issue. A junior systems administrator is investigating log files for clues. Which of the following commands should the administrator execute?
A. journalctl -u httpd
B. journalctl -l httpd
C. systemctl -s httpd
D. systemctl -l httpd
Due to security policies, a restriction was implemented that forbids direct access to the database server. The junior administrator needs to connect using SSH tunneling. Which of the following commands allows the junior administrator to connect from a desktop?
A. ssh ג€”L dbserver.local:5432:localhost:95432 postgres@dbserver.local
B. ssh ג€”L 5432:localhost dbserver.local:5432 postgres
C. ssh ג€”L 95432:localhost postgres@dbserver.local
D. ssh ג€”L 9432:localhost:5432 postgres@dbserver.local
A user wants to list the lines of a log, adding a correlative number at the beginning of each line separated by a set of dashes from the actual message. Which of the following scripts will complete this task? A.B.
C.
D.
A network administrator installed a web server on a Linux host and added a firewalld command to open port 80/tcp. The web server worked without error until an updated and patched kernel was installed on the system a month later. Now users are unable to access the web server even though the service is running. Which of the following would fix the issue?
A. Use the firewalld command to open the HTTP application service rather than the port
B. Change the firewalld zone to private and open port tcp/80
C. Issue an additional firewalld command to open up port tcp/443 as well as port tcp/80
D. Use the firewalld command to open tcp/80 both with and without the –permanent switch
A junior Linux administrator is performing version control on a Git repository. The administrator is given a list of tasks to complete: ✑ List the currently installed Git release. ✑ Show the status reporting of the clone. Which of the following commands would allow the administrator to complete these tasks? (Choose two.)
A. git clone –progress
B. git clone –recursive
C. git –help
D. git clone –dissociate
E. git –version
F. git clone –shared
Users are unable to connect to a server using HTTPS. The administrator runs the following command on the remote system:Then, the administrator runs the following command from a local workstation:
Which of the following steps should the administrator take to address the issue?
A. Start the application to run on port 443
B. Configure the application to run on an active port
C. Allow port 443 through the firewall
D. Update the self-signed certificate
A Linux administrator suspects unauthorized users are attempting to log in to the Linux server remotely. Which of the following should the administrator check FIRST?
A. /var/log/messages
B. /var/log/secure
C. /var/log/dmesg
D. /var/log/kern.log
After starting a long-running script, a systems administrator needs to verify the frequency of what is filling up the /var partition and kill it because it is consuming too much space. Which of the following is the correct sequence given only a terminal is available?
A. 1. CTRL-C 2. bg 3. watch df /var 4. CTRL-C 5. fg 6. CTRL-Z
B. 1. CTRL-C 2. fg 3. watch df /var 4. CTRL-Z 5. bg 6. CTRL-Z
C. 1. CTRL-Z 2. bg 3. watch df /var 4. CTRL-C 5. fg 6. CTRL-C
D. 1. CTRL-Z 2. bg 3. watch df /var 4. CTRL-Z 5. fg 6. CTRL-C
An administrator receives a warning about a filesystem filling up, and then identifies a large file located at /tmp/largelogfile. The administrator deletes the file, but no space is recovered on the filesystem. Which of the following commands would BEST assists the administrator in identifying the problem?
A. lsof | grep largelogfile
B. pkill /tmp/largelogfile
C. pgrep largelogfile
D. ps ג€”ef | grep largelogfile
A systems administrator documents the instructions on the internal wiki regarding how to turn the company's code into Debian packages. The instructions include the commands used to compile, what tests need to be run, the commands to convert the raw code into a package that apt or dpkg can manage, as well as an explanation of each command. Which of the following is this an example of?
A. Infrastructure as code
B. Attributes
C. Procedures
D. Configuration management
A system shows high utilization of swap space but low utilization of physical memory. Which of the following commands should an administrator run to free up usable swap space?
A. mkswap ; swapon -a
B. free && swapon -a
C. swapoff -a && swapon -a
D. swapon -a ; swapoff -a
A Linux team is using Git to version a set of custom scripts. A team member has made an update to a script and published the changes to the repository. Which of the following is the BEST way to retrieve the latest changes to the administrator's local working copy?
A. git fetch
B. git merge
C. git commit
D. git pull
A Linux systems administrator needs to copy the contents of a directory named `working` on the local working system to a folder /var/www/html on a server named `corporate-web`. Which of the following commands will allow the administrator to copy all the contents to the web server?
A. scp ג€”r working/* webuser@corporate-web:/var/www/html
B. tar working/* webuser@corporate-web:/var/www/html
C. cp ג€”r working/* webuser@corporate-web:/var/www/html
D. mv working webuser@corporate-web:/var/www/html
An administrator needs to deploy 100 identical CentOS workstations via PXE boot. Which of the following should the administrator use to minimize the amount of interaction with the consoles needed?
A. Kickstart script
B. Ghost image on a distribution server
C. Hard disk duplicator
D. Hard disk duplicator
E. Ubiquity script
A system ran out of storage space on a particular mount and will not allow anything to be written to disk. The df command shows there are 6GB free on the mount, and there is no inode exhaustion. This issue has happened before due to a known large log file that was not being rotated. The administrator remembers the file name but cannot remember the location of the log file or which process is writing to it. Which of the following would be the BEST solution to correct this issue while maintaining availability?
A. Use the lsof command to find where the large log file is located and truncate it
B. Use the locate command to find where the large log file is located and delete it
C. Use the du command to find where the large log file is located and delete it
D. Use the ps command to find which process is writing to the log file, and then kill and restart the process
A file server is sharing a directory called /share between team members inside a company. The fileshare needs to be moved from serverA to /newshare located on serverB with all permissions and attributes preserved. Which of the following commands would BEST achieve this task?
A. rsync -aHAX /share/* serverB:/newshare
B. dd if=/share/* of=serverB:/newshare
C. tar -cvf /share/* serverB:/newshare
D. mirrorlv /share/* serverB:/newshare
A systems administrator wants to mount an ISO to access its content. Using /mnt as a mount point, which of the following is the correct syntax?
A. mount -o iso9660 /dev/sr0 /mnt
B. mount -o loop -t iso /mnt
C. mount -o loop /tmp/image.iso /mnt
D. mount -o loop /dev/kvm /mnt
A junior Linux administrator receives a request to add a user, Ann, to the secondary group `cashiers`. Ann is also a member of the secondary group, `managers`. The administrator issues the following command: usermod -G cashiers Ann Later, Ann reports that she is unable to access any of the files or directories in `managers`. Which of the following commands should the administrator issue to resolve Ann's group memberships?
A. usermod -G cashiers,managers Ann
B. usermod -g cashiers,managers Ann
C. groupmod -G Ann cashiers,managers
D. groupmod -ga Ann cashiers,managers
A systems administrator needs to prevent the root account from being used to log in to a Linux server via SSH. Which of the following configuration files does the systems administrator need to edit to perform this task?
A. /etc/passwd
B. /etc/sshd_config
C. ~/.ssh/config
D. /etc/sysconfig/sshd
A systems administrator suspects a process with a PID of 2864 is consuming resources at an alarming rate. The administrator uses the command renice -n - 5 -p2864, but it does not solve the issue. Which of the following commands should the administrator execute to correct the issue?
A. nice -n 5 -p 2864
B. nice -n -5 -p 2864
C. renice -n 10 -p 2864
D. renice -n -10 -p 2864
DRAG DROP - 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. Select and Place:
A company wants to ensure that all newly created files can be modified only by their owners and that all new directory content can be changed only by the creator of the directory. Which of the following commands will help achieve this task?
A. umask 0022
B. umask 0012
C. chmod ג€”R 0644 /
D. chmod ג€”R 0755 /
An administrator has written the following Bash script:All necessary files exist in the correct locations. However, when the administrator executes /home/user/test.sh the following error is received: No such file or directory - Which of the following is the MOST likely cause of the error?
A. The shebang points to the wrong path.
B. The script is not executable.
C. The formatting of the file is incorrect.
D. Nslookup is not installed.
A Linux administrator retrieved a repository of files from a Git server using git clone. The administrator wants to see if a configuration file was added to the repository. Which of the following Git arguments should be used to see the recent modifications?
A. fetch
B. log
C. init
D. pull
A systems administrator installed Git on a new workstation and wants to ensure all Git projects on this machine are initialized with the same username and email address. Which of the following should the administrator use to meet this goal? (Choose two.)
A. git config –global user.name = ג€James Doeג€
B. echo ’email.addr = ג€jdoe@comptia.orgג€’ >> .git/.gitconfig
C. echo ‘username’ = ג€James Doeג€’ >> .git/.gitconfig
D. git config username = ג€James Doeג€
E. git config –global user.email = ג€jdoe@comptia.orgג€
F. git config email.addr = jdoe@comptia.orgג€
A server, which is used to collect data about the network and datacenter environment via SNMP, is running out of space. Which of the following should the server administrator implement to reduce disk utilization?
A. journald
B. Snapshots
C. logrotate
D. tar -cvf
A corporate server security policy states, `Ensure password hashes are not readable by non-administrative users.` The administrator should check the permissions on which of the following files to ensure the server satisfies this policy?
A. /etc/shadow
B. /etc/passwd
C. /etc/group
D. /etc/security/limits.conf
A systems administrator wants to download a package from a remote server. Which of the following are the BEST commands to use for this task? (Choose two.)
A. curl
B. wget
C. make
D. tar
E. zip
F. nc
While trying to access a website hosted on the server, the systems administrator receives the following error message:The administrator then performs some diagnostics:
Which of the following commands should the administrator use to fix the issue?
A. chown -R www:www /var/www/website
B. chcon -t httpd_sys_content_t /etc/httpd
C. chmod -R 777 /var/www/website
D. restorecon /var/www/html/website/index.html
A Linux administrator wants to obtain a list of files and subdirectories in the /etc directory that contain the word `services`. Once the files and subdirectories are discovered, they should be listed alphabetically in the /var/tmp/foundservices file. Which of the following shell scripts will accomplish this task?
A. #/bin/bash find /etc ג€”name services | sort > /var/tmp/foundservices
B. #/bin/bash locate /etc ג€”sort ג€”name services > /var/tmp/foundservices
C. #/bin/bash find ג€”name services ג€”sort /var/tmp/foundservices
A Linux administrator must identify a user with high disk usage. The administrator runs the # du `"s /home/* command and gets the following output:Based on the output, User3 has the largest amount of disk space used. To clean up the file space, the administrator needs to find out more information about the specific files that are using the most disk space. Which of the following commands will accomplish this task?
A. df ג€”k /home/User3/files.txt
B. du ג€”a /home/User3/*
C. du ג€”sh /home/User/
D. find . ג€”name /home/User3 -print
A senior systems administrator wants to standardize the commands used in the department and update documentation for junior Linux administrators for using systemd. Which of the following commands replaces the old command service named stop?
A. systemctl kill named
B. systemctl stop named
C. systemctl named stop
D. systemctl named kill
A newly installed desktop is unable to connect to networked resources. The systems administrator executes various commands and reviews the following output snippets:Which of the following should the systems administrator try NEXT to restore connectivity?
A. arp -s 20:ad:1f:ab:10:0f 192.168.1.10
B. route add -net 192.168.1.0 netmask 255.255.255.0
C. dig -x @127.0.0.1 192.168.1.10
D. ip link set wlo1 up
E. killall -HUP NetworkManager
A Linux administrator is using a public cloud provider to host servers for a company's website. Using the provider's tools, the administrator wrote a JSON file to define how to deploy the servers. Which of the following techniques did the administrator use?
A. Infrastructure as code
B. Build automation
C. Platform as a service
D. Automated configuration
A member of the production group issues the following command: echo "Monday through Friday" > /production_docs/days The command fails to execute, so the user obtains the following output: drwxr--r-- root production 0 Jun 16 2018 production -rw-r--r-- production production 4096 Jun 14 2018 days Which of the following commands should the user execute to BEST fix the issue?
A. chmod g+w production to change the permissions on the days file
B. chgrp root production_docs/days to change the group ownership of the production_docs/days file
C. chmod g+S production to set the GUID on the production_docs directory
D. chown production to change the ownership of the production_docs directory
Which of the following would allow remote users to access a corporate server? (Choose two.)
A. VPN server
B. SMTP server
C. NTP server
D. SSH server
E. DHCP server
F. File server
A Linux systems administrator is implementing Source Code Management for the web application server configuration files located in /etc/httpd/. Which of the following steps should the administrator perform FIRST?
A. Clone the remote repository using ‘git clone’
B. Create a new repository using ‘git init’
C. Retrieve the remote changes using ‘git commit’
D. Configure the directory for git using ‘git config’
Which of the following commands allow an administrator to determine if the current system is a virtual machine?
A. lspci
B. mdadm
C. vmstat
D. vgdisplay
A junior systems administrator needs to schedule a backup script named /scripts/backup.sh and make the correct changes to the crontab. Which of the following crontab entries would run the script every Monday at 2:05 a.m.?
A. 1 * * 5 2 /scripts/backup.sh
B. 2 5 * * 1 /scripts/backup.sh
C. 5 2 * * 1 /scripts/backup.sh
D. 1 * * 2 5 /scripts/backup.sh
E. 5 2 * * 0 /scripts/backup.sh
A systems engineer scheduled an at job that will reboot a critical server. A developer states the processes will not complete for another three hours. Which of the following will help the systems engineer to remove the job?
A. atq atrm
B. at -q atrm
C. atq atrm
D. at -q atrm
Which of the following is true about Type 2 hypervisors?
A. Type 2 hypervisors run on top of another general purpose OS.
B. Type 2 hypervisors are often called bare-metal or native hypervisors.
C. Type 2 hypervisors offer a performance increase to the guests in comparison to a Type 1 hypervisor.
D. Only Type 2 hypervisors allow direct access to CPU virtualization features.
Joe, a user, reports there is data missing after a reboot of the system he is using. The data he was working on was located in /opt/data/user1. A Linux administrator runs the following commands and receives the resulting output.Which of the following should the administrator perform to resolve the issue?
A. The administrator can conclude Joe no longer has permissions to his data and needs to change the data ownership to Joe.
B. The administrator can conclude the data is gone from the system and needs to be restored from a backup.
C. The administrator can conclude Joe has been using the wrong folder and should be using /opt/data/user2.
D. The administrator can conclude the drive is not mounted properly and should be remounted.
A technician's laptop is configured with wired and wireless interfaces. Both interfaces have obtained the appropriate IP address from the organization's DHCP server. Which of the following commands is MOST appropriate to remove the IP address from the wireless interface temporarily so network traffic is routed through the wired interface?
A. ip addr wlan0 del default
B. route delete default gw if wlan0
C. netstat -r wlan0
D. dhclient -r wlan0
A systems administrator clones copies of a Linux VM every time a new Linux server is needed. The administrator notices the command prompt always states localhost.localdomain. Which of the following should the administrator run to have the command prompt consistently labeled as Server1 rather than localhost.localdomain?
A. host Server1
B. echo “127.0.0.1 Server1 Server1.localdomain” >> /etc/hosts
C. hostnamectl set-hostname “Server1” –pretty
D. hostnamectl set-hostname Server1 –transient
E. hostnamectl set-hostname Server1.localdomain –static
Given the output below:[1] [1] [1] C. rm `"rf ./Pictures - [1] [1]
Free Access Full XK0-004 Practice Exam Free
Looking for additional practice? Click here to access a full set of XK0-004 practice exam free questions and continue building your skills across all exam domains.
Our question sets are updated regularly to ensure they stay aligned with the latest exam objectives—so be sure to visit often!
Good luck with your XK0-004 certification journey!