Last Updated on July 11, 2021 by Admin 1

XK0-004 : CompTIA Linux+ : Part 01

  1. Which of the following would be the BEST solution for a systems administrator to access the graphical user environment of a Linux machine remotely?

    • VNC
    • KDE
    • X11
    • RPC
  2. A technical support engineer receives a ticket from a user who is trying to create a 1KB file in the /tmp directory and is getting the following error: No space left on device. The support engineer checks the /tmp directory, and it has 20GB of free space.

    Which of the following BEST describes a possible cause for this error?

    • The /tmp directory is not mounted.
    • The filesystem is formatted with a 4MB block size.
    • the filesystem ran out of inodes.
    • The /tmp directory has been set with an immutable attribute.
  3. Which of the following is the BEST reason for not storing database files in the /var directory?

    • The /var filesystem is not fast enough for database files.
    • The number of files in /var is limited by the available inodes.
    • Files in /var do not have strict file permissions.
    • If log files fill up /var, it might corrupt the database.
  4. SIMULATION

    A junior system administrator had trouble installing and running an Apache web server on a Linux server. You have been tasked with installing the Apache web server on the Linux server and resolving the issue that prevented the junior administrator from running Apache.

    INSTRUCTIONS

    Install Apache and start the service. Verify that the Apache service is running with the defaults.
    Typing “help” in the terminal will show a list of relevant commands.
    If at any time you would like to bring back the initial state of the simulation, please click the Reset All button.

    CentOS Command Prompt

    XK0-004 Part 01 Q04 001
    XK0-004 Part 01 Q04 001

     

    • For correct answers: see the explanation below

    Explanation:

    XK0-004 Part 01 Q04 002
    XK0-004 Part 01 Q04 002
    XK0-004 Part 01 Q04 003
    XK0-004 Part 01 Q04 003
  5. DRAG DROP

    The lead Linux admin has added a disk, /dev/sdd, to a VM that is running out of disk space. Place the following steps in the correct order from first (1) to last (4) to add the disk to the existing LVM.

    XK0-004 Part 01 Q05 004
    XK0-004 Part 01 Q05 004
    XK0-004 Part 01 Q05 004
    XK0-004 Part 01 Q05 004
  6. 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?

    • lsof | grep largelogfile
    • pkill /tmp/largelogfile
    • pgrep largelogfile
    • ps –ef | grep largelogfile
  7. Which of the following can be used to boot a DVD from a remote device to initialize a Linux system setup on bare metal hardware as if it is a local DVD?

    • UEFI
    • PXE
    • NFS
    • GRUB
  8. 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?

    • 1. CTRL-C
      2. bg
      3. watch df /var
      4. CTRL-C
      5. fg
      6. CTRL-Z
    • 1. CTRL-C
      2. fg
      3. watch df /var
      4. CTRL-Z
      5. bg
      6. CTRL-Z
    • 1. CTRL-Z
      2. bg
      3. watch df /var
      4. CTRL-C
      5. fg
      6. CTRL-C
    • 1. CTRL-Z
      2. bg
      3. watch df /var
      4. CTRL-Z
      5. fg
      6. CTRL-C
  9. A Linux administrator must identify a user with high disk usage. The administrator runs the # du –s /home/* command and gets the following output:

    XK0-004 Part 01 Q09 006
    XK0-004 Part 01 Q09 006

    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?

    • df –k /home/User3/files.txt
    • du –a /home/User3/*
    • du –sh /home/User/
    • find . –name /home/User3 -print
  10. A Linux server has multiple IPs. A Linux administrator needs to verify if the HTTP server port is bound to the correct IP.

    Which of the following commands would BEST accomplish this task?

    • route
    • host
    • nslookup
    • netstat
    • ip
  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?

    • ls –lha /opt > test.txt
    • ls –lha /opt < test.txt
    • ls –lha /opt >> test.txt
    • ls –lha /opt << test.txt
  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?

    • curl www.comptia.org/contacts
    • dig www.comptia.org/contacts
    • apt-get www.comptia.org/contacts
    • yum list www.comptia.org/contacts
  13. Which of the following BEST describes containers running on a Linux system?

    • Containers only need the namespaces functionality to run on a Linux system available since kernel 2.6.
    • Containers need a hypervisor to run on a Linux system. Cgroups namespaces are functionalities used for the kernel but not for running containers.
    • Containers only need the cgroups functionality for running on a Linux system. Namespaces is not a Linux kernel functionality needed for creating and managing containers.
    • Containers use the cgroups and namespaces functionalities to isolate processes and assign hardware resources to each of those isolated processes.
  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?

    • XK0-004 Part 01 Q14 007
      XK0-004 Part 01 Q14 007
    • XK0-004 Part 01 Q14 008
      XK0-004 Part 01 Q14 008
    • XK0-004 Part 01 Q14 009
      XK0-004 Part 01 Q14 009
    • XK0-004 Part 01 Q14 010
      XK0-004 Part 01 Q14 010
  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?

    • bg ping remotehost
    • fg ping remotehost
    • ping remotehost < results
    • ping remotehost &
  16. A Linux administrator needs to switch from text mode to GUI. Which of the following runlevels will start the GUI by default?

    • Runlevel 3
    • Runlevel 4
    • Runlevel 5
    • Runlevel 6
  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.)

    • echo $LC_ALL
    • locale
    • cat $LC_ALL
    • export LANG = en_US.UTF-8
    • export $LANG = en_US.UTF
    • stty
  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?

    • nohup service network restart
    • service network restart &
    • echo “service network restart” | at now
    • bg service network restart
  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:

    XK0-004 Part 01 Q19 011
    XK0-004 Part 01 Q19 011

    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?

    • httpd_can_network_connect = 1
    • httpd_enable_scripting = 1
    • httpd_enable_homedirs = 1
    • httpd_enable_cgi = 1
  20. Which of the following BEST describes the purpose of the X11 system?

    • X11 provides graphical display capabilities
    • X11 provides command line capabilities
    • X11 provides networking capabilities
    • X11 provides telephony capabilities.