Special Summer Discounts Limited Time 55% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 63r59951

XK0-004 CompTIA Linux+ Certification Exam Questions and Answers

Questions 4

An administrator needs to create a shared directory in which all users are able, write, and execute its content but none of the regular users are able to delete any content.

Which of the following permissions should be applied to this shared directory?

Options:

A.

rwxrwxrwt

B.

rwxrwxrws

C.

rwxrwxrwx

D.

rwxrwxrw*

Buy Now
Questions 5

A server is almost out of free memory and is becoming unresponsive. Which of the following sets of commands will BEST mitigate the issue?

Options:

A.

free, fack, partprobe

B.

lsof, lvcreate, mdadm

C.

df, du, rmmod

D.

fdisk, mkswap, swapon -a

Buy Now
Questions 6

Given the output below:

Which of the following commands can be used to remove MyPhoto.jpg from the current directory?

Options:

A.

unlink ./MyPhoto.jpg

B.

del Pictures/photo.jpg

C.

rm –rf ./Pictures

D.

rm –f MyPhoto.jpg

E.

ln –rm ./Pictures/photo.jpg

Buy Now
Questions 7

Ann, a Linux administrator, is storing scripts in a private Git repository. Which of the following commands should Ann use to avoid entering the login and password every time Ann commits change?

Options:

A.

Git init shared-true

B.

Echo authe n tapprove ‘’>> .git/config

C.

Git credential approve

D.

Git config credential.help cache

Buy Now
Questions 8

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.)

Options:

A.

git clone --progress

B.

git clone --recursive

C.

git --help

D.

git clone --dissociate

E.

git --version

F.

git clone --shared

Buy Now
Questions 9

An administrator is trying to optimize a connection to an off-site NFS server.

Which of the following commands would BEST display the problems with packet sizes between hops on the network?

Options:

A.

tracepath

B.

ping

C.

tracert

D.

nmap

Buy Now
Questions 10

Which of the following can cause a kernel panic message after a system reboot?

Options:

A.

Processor failure

B.

PXE boot failure

C.

USB device failure

D.

Drive failure

Buy Now
Questions 11

An administrator needs a bootable USB for installing a new Linux machine. The administrator downloaded the

image file and named it as Linux_OS.iso in the /tmp directory. Which of the following commands will

accomplish that task?

Options:

A.

dd input=/tmp/Linux_OS.iso of=/dev/sda bs=512

B.

dd in=/tmp/Linux_OS.iso out=/dev/sdb bs=512

C.

dd if=/tmp/Linux_OS.iso of=/dev/sda bs=512

D.

dd if=/tmp/Linux_OS.iso out=/dev/sdb1 bs=512

Buy Now
Questions 12

A Linux administrator issues the following command with root or sudo privileges:

Rmp -1 installpackage.rpm --nodeps

Which of the following should the administrator expect to see in the output?

Options:

A.

The installpackage.rmp package will not fail due to checks for dependencies.

B.

The installpackage.rmp package will not fail due to missing dependencies

C.

The installpackage.rmp package will not be installed, and there will be dependencies

D.

The installpackage.rmp package will not be installed, and there not be check for dependencies

Buy Now
Questions 13

Which of the following techniques would BEST allow a client computer to connect to a server that is not normally accessible because the server’s application port is blocked by a firewall?

Options:

A.

X11 forwarding

B.

TCP wrappers

C.

RDP

D.

SSH port forwarding

Buy Now
Questions 14

A system administrator is setting up a cron job that will copy thousands files from a remote directory on a scheduled basic. The file contents should retain their original permissions, including and group ownership, and the cron job should run for the least amount of the possible. Which of the following is the BEST program to use in this situation?

Options:

A.

Rsync

B.

Curl

C.

Scp

D.

Wget

E.

sftp

Buy Now
Questions 15

An administrator is installing a Linux VM on a personal hypervisor. The administrator wants to have the VM’s IP address on the same network as the hypervisor host so the VM has the same network properties as the physical interface of the host. To which of the following should the administrator set the network properties?

Options:

A.

Host-only network

B.

NAT network

C.

Bridge network

D.

Overlay network

Buy Now
Questions 16

A systems administrator needs to conduct maintenance on a server.

Which of the following commands will place the administrator in the appropriate runlevel?

Options:

A.

init 0

B.

telinit 1

C.

init 3

D.

telinit 6

Buy Now
Questions 17

A Linux administrator receives the following while attempting to remove a file:

Which of the following commands will resolve the issue?

Options:

A.

cattr -i test.txt

B.

setfacl -m u:root:x test.txt

C.

chmod -0775 test.txt

D.

chcon -u system_u test.txt

Buy Now
Questions 18

A Linux administrator looks at the /etc/timezone file and determines the need to change the time zone from California to New York temporarily. Which of the following commands will accomplish this?

Options:

A.

sed -f TZ=America/New_York

B.

cat TZ=America/New_York

C.

export TZ=America/New_York

D.

printf TZ=America/New_York

Buy Now
Questions 19

A systems administrator is using a Linux laptop to troubleshoot network devices. The administrator runs the

following command:

# screen /dev/USB0

Which of the following does this command MOST likely accomplish?

Options:

A.

It copies the network traffic from the device connected to USB0 and screens out rejected traffic.

B.

It logs all troubleshooting output from the monitor to external USB0 storage.

C.

It monitors USB0 waiting for a network device to be connected to it as an Ethernet device.

D.

It allows the administrator to interact with the character device connected to USB0.

Buy Now
Questions 20

A junior systems administrator has generated a PKI certificate for SSH sessions. The administrator would like to configure authentication without passwords to remote systems. Which of the following should the administrator perform?

Options:

A.

Add the content of id_rsa.pub file to the remote system ~/.ssh/authorized_keys location.

B.

Add the content of id_rsa file to the remote system ~/.ssh/authorized_keys location.

C.

Add the content of id_rsa file to the remote system ~/.ssh/known_hosts location.

D.

Add the content of id_rsa.pub file to the remote system ~/.ssh/known_hosts location.

Buy Now
Questions 21

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?

Options:

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

Buy Now
Questions 22

An administrator wants to be able to access a remote server. After creating an SSH key pair, which of the following describes where the public key should be placed to allow for key-based authentication?

Options:

A.

-/, ssh/authorized_keys

B.

-/ssh/id_ras.pub

C.

-/.ssh/known_hosts

D.

-/.ssh/config

Buy Now
Questions 23

A system administrator is investigating why user3 cannot log in using SSH to one of the servers.

An attempt to log in results in the following:

Which of the following commands should the systems administrator execute to allow user3 log in to the server?

Options:

A.

Restorecon /bin/rssh

B.

Passwd/-u user3

C.

Usermod/ -s /bin/sh user3

D.

Setfac1/ bin/rssh

Buy Now
Questions 24

A systems administrator receives a report that the web server is not running after a planned system reboot.

After starting the web server manually, which of the following commands should the administrator issue to ensure the web server starts at boot time?

Options:

A.

systemctl service on

B.

systemctl enable .service

C.

systemctl service enable

D.

systemctl on .service

Buy Now
Questions 25

A Linux administrator has configured a local named caching server to reduce the amount of time to resolve common DNS addresses. The server resolves using the external server, however; the administrator wants to avoid this configuration. The administrator verifies the named, conf settings to confirm the following relevant settings:

The administrator then runs dig twice to look up an external address and receives the following relevant output the second time.

Which of the following should the administrator do to correct the configuration?

Options:

A.

Modify /etc/resolve.config and set nameserver to 127.0.0.1

B.

Add 1270.0.1 to the forwards in the named confi file.

C.

Alias the dig commands to use nslookup instead.

D.

Configure the name service in system to be masked

Buy Now
Questions 26

A Linux administrator wants to configure log messages of critical or higher severity levels from the cron utility to be logged to the console. Which of the following will accomplish this objective?

Options:

A.

Edit the /etc/logrotate.d/cron file to include the line cron.emerg.* /dev/console

B.

Edit the /etc/rsyslog.conf file to include the line cron.emerg.* /dev/console

C.

Edit the /etc/logrotate.conf file to include the line cron.emerg.* /dev/console

D.

Edit the /etc/rsyslog.d/conf file to include the line cron.emerg.* /dev/console

Buy Now
Questions 27

Using which of the following control mode commands is the correct way to substitute all occurrences of /dev/

sdc with /dev/sdd while editing a file in vi?

Options:

A.

:s//dev/sdc//dev/sdd

B.

:s/\/dev\/sdc/\/dev\/sdd/g

C.

:s/\/dev\/sdc/\/dev\/sdd

D.

:%s/\/dev\/sdc/\/dev\/sdd

Buy Now
Questions 28

The following represents a partial listing of a user’s .bashrc file:

HISTSIZE=800

HISTFILESIZE=1000

umask 2002

HISTCONTROL=ignoreboth

When the user opens a terminal, an error message appears:

Octal number out of range

Which of the following lines in the partial .bashrc should be modified to prevent the error from occurring?

Options:

A.

HISTSIZE=800

B.

HISTFILESIZE=1000

C.

umask 2002

D.

HISTCONTROL=ignoreboth

Buy Now
Questions 29

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 of each command.

Which of the following is this an example of?

Options:

A.

Infrastructure as code

B.

Attributes

C.

Procedures

D.

Configuration management

Buy Now
Questions 30

An administrator completed the configuration of the in-addr.arpa zone files for an organization.

Which of the following commands should the administrator use to verify the configuration is working as expected?

Options:

A.

ping -n 192.168.1.100

B.

host in-add.arpa

C.

dig -x 192.168.1.100

D.

nslookup in-addr.arpa

E.

tracepath -n 192.168.1.100

Buy Now
Questions 31

A systems administrator wants to install a new application that requires the newmod kernel module. Which of

the following commands should the systems administrator use?

Options:

A.

lsof newmod

B.

modinfo newmod

C.

lsmod newmod

D.

modprobe newmod

Buy Now
Questions 32

A junior Linux administrator needs to ensure a service will start on system boot. Which of the following commands should be used to accomplish this task?

Options:

A.

chkconfig on

B.

systemctl bootup

C.

service enable

D.

crontab install

Buy Now
Questions 33

A junior systems administrator created a new filesystem /dev/sda1 with mountpoint /data and added it to the /etc/fstab for auto-mounting.

When the systems administrator tries to mount the file system, the system refuses. Given the output below:

Which of the following steps is necessary?

Options:

A.

Change the filesystem from /dev/sda1 to /dev/sda2 and reboot.

B.

Change the options to auto,dev,sync,rw,nosuid and run the mount -a command.

C.

Change the mount point to data and reboot.

D.

Change the dump column to 1 and run the mount -a command.

Buy Now
Questions 34

A junior administrator is migrating a virtual machine from a Type 1 hypervisor to a Type 2 hypervisor. To ensure portability, which of the following formats should the administrator export from the Type 1 hypervisor to ensure compatibility?

Options:

A.

OWASP

B.

VDI

C.

VMDK

D.

OVA

Buy Now
Questions 35

A Linux administrator installed a new network adapter and temporarily disabled the network service from starting on boot. The partial output of chkconfig is as follows:

Which of the following commands BEST describes how the administrator should re-enable the network service?

Options:

A.

chkconfig --level 0 network on

B.

chkconfig --level 0-6 network on

C.

chkconfig --level 6 network on

D.

chkconfig --level 12 network on

E.

chkconfig --level 345 network on

Buy Now
Questions 36

A Linux administrator opens a ticket to have an external hard drive mounted. As a security policy, external storage kernel modules are disabled.

Which of the following is the BEST command for adding the proper kernel module to enable external storage modules?

Options:

A.

rmmod /lib/modules/3.6.12-100-generic/kernel/drivers/usb/storage/usb-storage.ko

B.

modinfo /lib/modules/3.6.12-100-generic/kernel/drivers/usb/storage/usb-storage.ko

C.

depmod /lib/modules/3.6.12-100-generic/kernel/drivers/usb/storage/usb-storage.ko

D.

insmod /lib/modules/3.6.12-100-generic/kernel/drivers/usb/storage/usb-storage.ko

Buy Now
Questions 37

Which of the following is a difference between YAML and JSON?

Options:

A.

Users can comment in YAML but not in JSON

B.

JSON only curly brackets, while YAML only uses square brackets

C.

JSON is used in web development, while YAML is used solely in back-end systems.

D.

YAML has been deprecated for JSON.

Buy Now
Questions 38

An analyst is trying to determine which public IP addresses are managed by Company A, but the script is not working correctly.

Which of the following explains what is wrong with the script?

Options:

A.

$(cat ip-list.txt) should be changed to `cat ip-list.txt` in the for statement.

B.

The for should be changed to while in the loop.

C.

The > should be changed to 2> in the do statement.

D.

The -ne flag should be changed to -eq in the if statement.

Buy Now
Questions 39

Joe, a user, reports that he is no longer able to write files to his home directory. Upon inspection, the Linux

administrator discovers that attempting to create a new file gives the following error: No space left on device. However, the disk and partition are not full. Which of the following commands would be BEST for the administrator to use to continue troubleshooting this problem?

Options:

A.

rm -Rf ~/.*

B.

fsck -y /dev/sda1

C.

df -i

D.

fdisk /dev/sda

Buy Now
Questions 40

A Linux administrator needs to back up the folder /usr/domain, and the output must be a gzip compressed tar. Which of the following commands should be used?

Options:

A.

tar –cv domain.tar.gz /usr/domain

B.

tar –cvf /usr/domain domain.tar.gz

C.

tar –czvf domain.tar.gz /usr/domain

D.

tar –cxzv /usr/domain domain.tar.gz

Buy Now
Questions 41

An administrator needs to see the type of CPU that a server is running. Which of the following files contains this information?

Options:

A.

/proc/cpuinfo

B.

/etc/devices/info.conf

C.

/dev/proc/cpu

D.

/sys/dev/cpuinfo

Buy Now
Questions 42

A Linux administrator needs to take stock of USB devices attached to the system.

Which of the following commands would be BEST to complete this task?

Options:

A.

lspci

B.

lsusb

C.

cat /proc/USB

D.

modprobe -–usb

Buy Now
Questions 43

A Linux administrator needs to switch from text mode to GUI. Which of the following runlevels will start the GUI by default?

Options:

A.

Runlevel 3

B.

Runlevel 4

C.

Runlevel 5

D.

Runlevel 6

Buy Now
Questions 44

An administrator receives a warning about a file system filling up, and then identifies a large file located at /tmp/largelogfile. The administrator deletes the file, but no space is recovered on the file system.

Which of the following commands would BEST assists the administrator in identifying the problem?

Options:

A.

lsof | grep largelogfile

B.

pkill /tmp/largelogfile

C.

pgrep largelogfile

D.

ps –ef | grep largelogfile

Buy Now
Questions 45

Ann, a user, has created a new directory and noticed that permissions on the new directory are as follows:

drwx------. 1 ann ann 0 Jun 11 08:20 work

Which of the following should the administrator do to restore default permissions for newly created directories?

Options:

A.

Change umask value in /etc/profile.

B.

Run chmod command to update permissions.

C.

Modify directory ownership to ann:ann with chown.

D.

Execute chattr command to restore default access.

Buy Now
Questions 46

A junior Linux administrator is setting up system-wide configuration settings. The goal is to ensure the PATH environment variable includes the following locations for all users who log into a Linux system.

The administrator issues the following commands at the terminal:

Respectively, the output of these commands is as follows:

Given this output, which of the following would be the BEST action for the administrator to perform to address this issue?

Options:

A.

Update the /etc/profile.d file using a text editor, navigate to the PATH element add the missing locations, and run the bash_completion.sh script to update the changes.

B.

Update the /etc/profile file using a text editor, navigate to the PATH element, add the missing locations and run the . /etc/profile command to update the changes.

C.

Update the /etc/profile.d file using a text editor, navigate to the PATH element, add the missing locations, and reboot to update the changes.

D.

Update the /etc/profile file using a text editor navigate to the PATH element, add the missing locations, and restart the bash process to update the changes.

Buy Now
Questions 47

A Linux administrator built a GitLab server. Later that day, a software engineer tried to access the server to upload the repository during the final step of installation. The software engineer could not access the website. Which of the following firewall rules would allow access to this site?

Options:

A.

iptables –A INPUT –p tcp –m multiport --dports 80,443 –m conntrack –cstate NEW, ESTABLISHED –j ACCEPT

B.

iptables –A INPUT –p tcp –m multiport --dports 80,443 –m conntrack –cstate ESTABLISHED –j ACCEPT

C.

iptables –A INPUT –p tcp –m multiport --dports 80,443 –m conntrack –cstate RELATED, ESTABLISHED –j ACCEPT

D.

iptables –A INPUT –p tcp –m multiport --dports 80,443 –m conntrack –cstate NEW, ESTABLISHED –j REJECT

Buy Now
Questions 48

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?

Options:

A.

Kickstart script

B.

Ghost image on a distribution server

C.

Hard disk duplicator

D.

Hard disk duplicator

E.

Ubiquity script

Buy Now
Questions 49

A Linux administrator needs to schedule a cron job to run at 1:15 p.m. every Friday to report the amount of free disk space on the system and to send the output to a file named “freespace”. Which of the following would meet this requirement?

Options:

A.

13 15 * * 5 df > /freespace

B.

15 13 * * 5 df > /freespace

C.

15 1 * * 6 df > /freespace

D.

15 13 6 * * df > /freespace

Buy Now
Questions 50

A Linux systems administrator needs to set permissions on an application with the following parameters:

The owner of the application should be able to read, write, and execute the application.

Members of the group should be able to read and execute the application.

Everyone else should not have access to the application.

Which of the following commands would BEST accomplish these tasks?

Options:

A.

chmod 710

B.

chmod 730

C.

chmod 750

D.

chmod 760

Buy Now
Questions 51

A systems administrator notices several intensive tasks executing from users Joe and Ann. These processes

are impacting server operations but must be allowed to continue running.

Which of the following commands should the systems administrator run to reduce the impact on the server?

Options:

A.

pkill -u joe ann

B.

renice 11 -u joe ann

C.

nohup -u joe ann

D.

strace -u joe ann

Buy Now
Questions 52

A Linux administrator is investigating an issue with an internal Linux server that is unable to resolve the following internal addresses:

The administrator runs the following commands as part of troubleshooting:

Which of the following is MOST likely resolve the issue?

Options:

A.

Allow outbound DNS traffic to the internal DNS server.

B.

Add a public DNS for fileshare, example, internal.

C.

Install a caching DNS server on the local workstation.

D.

Update resolve, conf to use the internal DNS server.

Buy Now
Questions 53

Which of the following commands should a Linux administrator use to open the firewall to allow incoming database connections?

A)

B)

C)

D)

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 54

Users in the payroll department are not configured to use DNS due to security concerns. The users ask the

junior Linux administrator to configure their workstations to access the payroll server at 192.168.204.11 by the

name “Payroll”. Which of the following commands should the administrator issue to meet this request?

Options:

A.

echo “nameserver 192.168.204.11 #Payroll” >> /etc/resolv.conf

B.

echo “net.ipv4.ip_dynaddr=192.168.204.11 Payroll” >> /etc/sysctl.conf

C.

echo “192.168.204.11 Payroll” >> /etc/hosts

D.

echo ‘IPADDR=”192.168.204.11” #Payroll’ >> /etc/network/interface

Buy Now
Questions 55

A junior systems is configuring localization option environment variables. The administrator is given a checklist of tasks with the following requirements:

View current settings of the LC_ALL environment variable only.

Modify the LANG environment variable to US English Unicode.

Given this scenario, which of the following should be performed to meet these requirements? (Choose two.)

Options:

A.

echo $LC_ALL

B.

locale

C.

cat $LC_ALL

D.

export LANG = en_US.UTF-8

E.

export $LANG = en_US.UTF

F.

stty

Buy Now
Exam Code: XK0-004
Exam Name: CompTIA Linux+ Certification Exam
Last Update: Jun 29, 2022
Questions: 372

PDF + Testing Engine

$79.2  $175.99

Testing Engine

$59.4  $131.99
buy now XK0-004 testing engine

PDF (Q&A)

$49.5  $109.99
buy now XK0-004 pdf