Linux Flashcards
Which of the following would be the BEST solution for a systems administrator to access the graphical user environment of a Linux machine remotely?
A. VNC
B. KDE
C. X11
D. RPC
A. VNC
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?
A. The /tmp directory is not mounted.
B. The filesystem is formatted with a 4MB block size.
C. the filesystem ran out of inodes.
D. The /tmp directory has been set with an immutable attribute.
C. the filesystem ran out of inodes.
Which of the following is the BEST reason for not storing database files in the /var directory?
A. The /var filesystem is not fast enough for database files.
B. The number of files in /var is limited by the available inodes.
C. Files in /var do not have strict file permissions.
D. If log files fill up /var, it might corrupt the database.
D. If log files fill up /var, it might corrupt the database.
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. lsof | grep largelogfile
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?
A. UEFI
B. PXE
C. NFS
D. GRUB
A. UEFI
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
D. 1. CTRL-Z 2. bg 3. watch df /var 4. CTRL-Z 5. fg 6. CTRL-C
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?
A. route
B. host
C. nslookup
D. netstat
E. ip
D. netstat
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?
A. ls –lha /opt > test.txt
B. ls –lha /opt < test.txt
C. ls –lha /opt >> test.txt
D. ls –lha /opt << test.txt
C. ls –lha /opt >> test.txt
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?
A. curl www.comptia.org/contacts
B. dig www.comptia.org/contacts
C. apt-get www.comptia.org/contacts
D. yum list www.comptia.org/contacts
A. curl www.comptia.org/contacts
Which of the following BEST describes containers running on a Linux system?
A. Containers only need the namespaces functionality to run on a Linux system available since kernel 2.6.
B. Containers need a hypervisor to run on a Linux system. Cgroups namespaces are functionalities used for the kernel but not for running containers.
C. 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.
D. Containers use the cgroups and namespaces functionalities to isolate processes and assign hardware resources to each of those isolated processes.
D. Containers use the cgroups and namespaces functionalities to isolate processes and assign hardware resources to each of those isolated processes.
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?
A. bg ping remotehost
B. fg ping remotehost
C. ping remotehost < results
D. ping remotehost &
C. ping remotehost < results
A Linux administrator needs to switch from text mode to GUI. Which of the following runlevels will start the GUI by default?
A. Runlevel 3
B. Runlevel 4
C. Runlevel 5
D. Runlevel 6
C. Runlevel 5
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.
A. nohup service network restart
B. service network restart &
C. echo “service network restart” | at now
D. bg service network restart
A. nohup service network restart
An administrator is analyzing a Linux server which was recently hacked. Which of the following will the administrator use to find all unsuccessful login attempts?
A. nsswitch
B. faillock
C. pam_tally2
D. passwd
C. pam_tally2
A junior administrator needs to unload an older video kernel module. Which of the following commands would BEST accomplish this task?
A. modprobe
B. insmod
C. rmmod
D. chmod
E. depmod
A. modprobe
An administrator is attempting to block SSH connections to 192.168.10.24 using the Linux firewall. After implementing a rule, a connection refused error is displayed when attempting to SSH to 192.168.10.24. Which of the following rules was MOST likely implemented?
A. iptables –A –p tcp –d 192.168.10.24 –-dport 22 –j REJECT
B. iptables –A –p tcp –d 192.168.10.24 –-dport 22 –j DROP
C. iptables –A –p tcp –d 192.168.10.24 –-dport 22 –j FORWARD
D. iptables –A –p tcp –d 192.168.10.24 –-dport 22 –j REFUSE
A. iptables –A –p tcp –d 192.168.10.24 –-dport 22 –j REJECT
A Linux systems administrator needs to provision multiple web servers into separate regional datacenters. The systems architect has instructed the administrator to define the server infrastructure using a specific tool that consumes a text-based file. Which of the following is the BEST reason to do this?
A. To document the infrastructure so it can be included in the system security plan
B. To ensure the administrator follows the planning phase of the systems development life cycle
C. To define the infrastructure so it can be provisioned consistently with minimal manual tasks
D. To validate user requirements have been met within each regional datacenter for compliance
B. To ensure the administrator follows the planning phase of the systems development life cycle
A Linux 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?
A. chmod 710
B. chmod 730
C. chmod 750
D. chmod 760
C. chmod 750
A junior Linux administrator is trying to verify connectivity to the remote host host1 and display round-trip statistics for ten ICMP requests. Which of the following commands should the administrator execute?
A. ping –c 10 host1
B. traceroute –c 10 host1
C. netstat host1
D. pathping –c 10 host1
A. ping –c 10 host1
A junior Linux administrator is updating local name resolution to support IPv6. The administrator issues the command cat /etc/hosts and receives the following output: 127.0.0.1 localhost Which of the following actions should the administrator perform to accomplish this task?
A. Modify the /etc/hosts file, and add the ipv6 localhost entry to the file.
B. Modify the /etc/hosts file, and add the ::1 localhost entry to the file.
C. Modify the /etc/hosts file, and add the ipv4 localhost entry to the file.
D. Modify the /etc/hosts file, and add the 0.0.0.0 localhost entry to the file.
B. Modify the /etc/hosts file, and add the ::1 localhost entry to the file.