CompTIA XK0-004 Exam Practice Questions (P. 2)
- Full Access (456 questions)
- Six months of Premium Access
- Access to one million comments
- Seamless ChatGPT Integration
- Ability to download PDF files
- Anki Flashcard files for revision
- No Captcha & No AdSense
- Advanced Exam Configuration
Question #11
A systems administrator needs to append output of ls `"lha /opt command to the contents of a test.txt file. Which of the following commands will accomplish this?
- Als ג€"lha /opt > test.txt
- Bls ג€"lha /opt < test.txt
- Cls ג€"lha /opt >> test.txt
- Dls ג€"lha /opt << test.txt
Correct Answer:
C
Reference:
https://www.cyberciti.biz/faq/linux-append-text-to-end-of-file/
C
Reference:
https://www.cyberciti.biz/faq/linux-append-text-to-end-of-file/
send
light_mode
delete
Question #12
A Linux administrator needs to remotely update the contents of the www.comptia.org/contacts URL.
Which of the following commands would allow the administrator to download the current contents of the URL before updating?
Which of the following commands would allow the administrator to download the current contents of the URL before updating?
- Acurl www.comptia.org/contacts
- Bdig www.comptia.org/contacts
- Capt-get www.comptia.org/contacts
- Dyum list www.comptia.org/contacts
Correct Answer:
A
Reference:
https://www.thegeekstuff.com/2012/04/curl-examples/
A
Reference:
https://www.thegeekstuff.com/2012/04/curl-examples/
send
light_mode
delete
Question #13
Which of the following BEST describes containers running on a Linux system?
- AContainers only need the namespaces functionality to run on a Linux system available since kernel 2.6.
- BContainers need a hypervisor to run on a Linux system. Cgroups namespaces are functionalities used for the kernel but not for running containers.
- CContainers only need the cgroups functionality for running on a Linux system. Namespaces is not a Linux kernel functionality needed for creating and managing containers.
- DContainers use the cgroups and namespaces functionalities to isolate processes and assign hardware resources to each of those isolated processes.
Correct Answer:
D
Reference:
https://www.linuxjournal.com/content/everything-you-need-know-about-linux-containers-part-ii-working-linux-containers-lxc
D
Reference:
https://www.linuxjournal.com/content/everything-you-need-know-about-linux-containers-part-ii-working-linux-containers-lxc
send
light_mode
delete
Question #14
A networked has been crashing intermittently. A Linux administrator would like to write a shell script that will attempt to ping the server and email an alert if the server fails to respond. The script will later be scheduled via cron job.
Which of the following scripts would BEST accomplish this task?
A.

B.

C.

C.
D.

Which of the following scripts would BEST accomplish this task?
A.

B.

C.

C.
D.

send
light_mode
delete
Question #15
A Linux administrator is testing connectivity to a remote host on a shared terminal. The administrator wants to allow other users to access the terminal while the command is executing.
Which of the following commands should the administrator use?
Which of the following commands should the administrator use?
- Abg ping remotehost
- Bfg ping remotehost
- Cping remotehost < results
- Dping remotehost &Most Voted
Correct Answer:
C
C
send
light_mode
delete
Question #16
A Linux administrator needs to switch from text mode to GUI. Which of the following runlevels will start the GUI by default?
- ARunlevel 3
- BRunlevel 4
- CRunlevel 5
- DRunlevel 6
Correct Answer:
C
Reference:
http://www.linfo.org/runlevel_def.html
C
Reference:
http://www.linfo.org/runlevel_def.html
send
light_mode
delete
Question #17
A junior systems administrator 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.)
✑ 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.)
- Aecho $LC_ALLMost Voted
- Blocale
- Ccat $LC_ALL
- Dexport LANG = en_US.UTF-8Most Voted
- Eexport $LANG = en_US.UTF
- Fstty
Correct Answer:
BD
Reference:
https://www.tecmint.com/set-system-locales-in-linux/
BD
Reference:
https://www.tecmint.com/set-system-locales-in-linux/
send
light_mode
delete
Question #18
An administrator needs to change the IP address on a server remotely. After updating the configuration files, a network restart is needed. However, the administrator fears that when the network connection drops, the network restart script will be killed before the new IP address has been set.
Which of the following commands would prevent the script from being killed?
Which of the following commands would prevent the script from being killed?
- Anohup service network restart
- Bservice network restart &
- Cecho ג€service network restartג€ | at now
- Dbg service network restart
Correct Answer:
A
A
send
light_mode
delete
Question #19
A Linux administrator is testing a new web application on a local laptop and consistently shows the following 403 errors in the laptop's logs:

The web server starts properly, but an error is generated in the audit log. Which of the following settings should be enabled to prevent this audit message?

The web server starts properly, but an error is generated in the audit log. Which of the following settings should be enabled to prevent this audit message?
- Ahttpd_can_network_connect = 1Most Voted
- Bhttpd_enable_scripting = 1
- Chttpd_enable_homedirs = 1
- Dhttpd_enable_cgi = 1
Correct Answer:
A
A
send
light_mode
delete
Question #20
Which of the following BEST describes the purpose of the X11 system?
- AX11 provides graphical display capabilities
- BX11 provides command line capabilities
- CX11 provides networking capabilities
- DX11 provides telephony capabilities.
Correct Answer:
A
Reference:
https://en.wikipedia.org/wiki/X_Window_System
A
Reference:
https://en.wikipedia.org/wiki/X_Window_System
send
light_mode
delete
All Pages