Study Guide - Practice Test Flashcards
(117 cards)
2- Which open source database implements advanced database features but can be slower to use?
- MongoDB
- MySQL
- PostgreSQL
- NoSQL
- Oracle
PostgreSQL
The PostgreSQL open source database server is well known for utilizing advanced database features commonly found in commercial database servers, but it can be somewhat slower when processing data, making option C correct. The MongoDB, MySQL, and NoSQL open source databases are designed for speed and implement varying levels of advanced database features, but they don’t provide all the advanced features of commercial databases, so options A, B, and D are incorrect. The Oracle database implements advanced database features but is not an open source database, so option E is incorrect.
4- Which logging program do systemd systems use?
rsyslogd
ntpd
dhcpd
journald
httpd
journald
Systemd systems use the journald program for logging system events, so option D is correct. The rsyslogd program is commonly used by SysVinit systems for logging events, but not systemd systems, so option A is incorrect. The ntpd, dhcpd, and httpd programs provide network services for time, configuration, and web services respectively, but not logging services, so options B, C, and E are all incorrect.
rsyslogd
the traditional system logging daemon that collects, processes, and stores log messages in plain text files (typically in /var/log/), using the syslog protocol and configurable through /etc/rsyslog.conf
journald
systemd’s modern logging service that captures system and service logs in a structured binary format, storing them in the systemd journal with advanced querying capabilities through journalctl
systemd
- a modern init system and service manager that serves as PID 1, responsible for booting the Linux system, starting/stopping services, and managing system processes throughout the system lifecycle
- It replaces traditional SysV init scripts with unit files (service, socket, timer, etc.) that define how services should be started, dependencies, and runtime behavior, managed through commands like systemctl and journalctl
- systemd provides parallel service startup for faster boot times, automatic service restarts, dependency management, and integrated logging through journald, making it the default init system on most major Linux distributions
5- What server role should you implement to speed up web browsing for local clients?
A web proxy
A DHCP server
A web server
A container
An SMTP server
A web proxy
A web proxy server has the ability to cache pages retrieved from remote web servers and relay those web pages to local clients when the same web page is requested again, helping to speed up web browsing for local clients, making option A correct. A DHCP server only provides IP and host configuration settings to network devices, not speed up web browsing, so option B is incorrect. A standard web server must retrieve web pages individually for each client, so it doesn’t speed up web browsing for the individual clients, making option C incorrect. A container helps make software development easier by duplicating the development environment into a form that can be transportable between multiple servers, but it doesn’t help speed up web browsing for clients, making option D incorrect. An SMTP server is used to provide email service, not web services, so option E is incorrect.
6- You need to delete files in a directory as well as any empty subdirectories. You want to be asked permission before deleting each file and receive detailed information as the command executes. Which command and option combination should you use?
- rmdir -v directory
- rmdir -vp directory
- rm -ivf directory
- rm -Id directory
- rm -ivd directory
rm -ivd directory
The rm -ivd directory command will delete the files and any empty subdirectories in the directory. In addition, it will ask permission before deleting each file and provide detailed information. Therefore, option E is the correct answer. The rmdir -v directory command will only attempt to delete the directory, and only if it is empty. Therefore, option A is a wrong answer. The rmdir -vp directory command will only attempt to delete the directory files, but not any subdirectories in it. Thus, option B is also an incorrect answer. The rm -ivf directory command does not delete any empty subdirectories in the directory. Therefore, option C is a wrong choice. The rm -Id directory command does not provide verbose information and will only ask before deleting three files. Thus, option D is also an incorrect choice.
7- Which of the following are ways to identify that a text file is hard‐linked to another file? (Choose all that apply.)
- The file shares an inode number with another file.
- The file does not share an inode number with another file.
- The file has a file indicator code of l in its long listing.
- The file has a link count greater than 1.
- The file shares the same data with another file.
- The file shares an inode number with another file.
- The file has a link count greater than 1.
- The file shares the same data with another file.
Indicators that a text file is hard‐linked to another file are the file shares an inode number with another file, the text file has a link count greater than 1, and the file shares the same data with another file. Thus, options A, D, and E are all correct answer. Soft (symbolic)‐linked files do not share an inode number with another file and have a file indicator code of l in their long listing. Therefore, both options B and C are incorrect choices.
watch
The watch command allows you to execute a program periodically and view the command’s output
9- You need to locate files within the /tmp directory or one of its subdirectories. These files should be empty. Assuming you have super user privileges, what command should you use?
- find / -name tmp
- find /tmp -empty
- find /tmp -empty 0
- find /tmp/ * -name empty
- find / -empty
find /tmp -empty
The find /tmp -empty command will locate files within the /tmp directory or one of its subdirectories, which are empty. Therefore, option B is the right answer. The find / -name tmp command starts at the root directory instead of the /tmp directory and searches for files/directories whose names are tmp. Thus, option A is a wrong answer. The find /tmp -empty 0 command adds an incorrect additional argument, 0, at the end of the command, so option C is also an incorrect answer. The find /tmp/* -name empty command searches for files/directories whose names are tmp and adds an unnecessary wildcard, *, to the directory name to search. Thus, option D is also a wrong choice. The find / -empty command starts at the root directory instead of the /tmp directory. Therefore, option E is an incorrect choice.
10- Which of the following are filter commands? (Choose all that apply.)
- egrep
- sort
- grep
- cut
- pr
- egrep
- grep
- cut
In the option list, only the egrep, grep, and cut commands are considered to be filter commands, because they filter out text. Therefore, options A, C, and D are correct. The sort and pr commands are formatting commands, and thus options B and D are incorrect choices.
egrep
- egrep is an extended version of grep that supports extended regular expressions (ERE) by default, allowing more complex pattern matching with metacharacters like +, ?, |, and parentheses without needing to escape them
- It’s equivalent to running grep -E and enables advanced regex features like alternation (pattern1|pattern2), quantifiers (+, ?), and grouping with parentheses for more sophisticated text searches
- Common usage: egrep “error|warning|fail” /var/log/messages to search for multiple patterns, or egrep “^(root|admin)” /etc/passwd to find lines starting with specific usernames using grouping and alternation
pr
a text formatting command that prepares files for printing by adding headers, page numbers, columns, and line numbering - commonly used with options like -n for line numbers, -h for custom headers, and -l for page length
sort
arranges lines of text files in alphabetical, numerical, or custom order, with useful options like -n for numerical sorting, -r for reverse order, -k for sorting by specific fields, and -u for removing duplicates
11- Which of the following symbols could be used to redirect STDOUT? (Choose all that apply.)
- 2˃
- ≫
- ≪
- ˃
- |
- ≫
- ˃
- |
The ≫ symbols will allow you to redirect STDOUT from a command and append the redirected content to a file. Therefore, option B is a correct choice. The ˃ symbol will allow you to redirect STDOUT from a command and place the redirected content to a file, creating it if the file does not previously exist or overwriting its contents if it does already exits. Therefore, option D is a correct choice. The | symbol, called the pipe, will allow you to redirect STDOUT from a command to STDIN of another command. Therefore, option E is also a correct answer. Option A redirects STDERR, represented by the 2 file descriptor, so therefore it is a wrong answer. Option C is an incorrect choice because the ≪ symbols are for STDIN redirection associated with a here document.
12- Within the nano text editor’s help subsystem, you’ll see some metacharacter key combinations denoted by M-k. Which of the following keys may the M represent? (Choose all that apply.)
- Ctrl
- Esc
- Alt
- Meta
- Esc
- Alt
- Meta
For the metacharacter key combinations, the M represents the Esc, Alt, or Meta key, depending on your keyboard’s setup. Thus, options B, C, and E are correct answers. The Ctrl key is typically used in conjunction with other nano text editor key combination functions, such as Ctrl+O to output the text editor’s buffer to a file. Therefore, option A is a wrong answer. The ^ is a symbol used to denote use of the Ctrl key within certain nano text editor key combinations, and thus option D is also an incorrect choice.
13- The command echo “a b c d” | gawk ‘{print $1}’ is issued at the command line. What will be displayed?
- a
- b
- c
- d
- a b c d
a
The gawk utility defines a data field as characters separated by a space with a text line. The $1 data field is the first data field in a text line. Therefore, the command will display a to STDOUT, and option A is the correct answer. For b to display, the $1 in the gawk command needs to be changed to $2. Thus, option B is the wrong answer. For c to display, the $1 in the gawk command needs to be changed to $3. Therefore, option C is also a wrong choice. For d to display, the $1 in the gawk command needs to be changed to $4. Thus, option D is an incorrect answer. For a b c d to display, the $1 in the gawk command needs to be changed to $0. Therefore, option E is also an incorrect choice.
gawk
- the GNU implementation of the AWK programming language, a powerful text processing tool that scans files line-by-line and performs pattern matching and actions on structured data like CSV files or log files
- It excels at field-based processing where you can reference columns using variables like $1 (first field), $2 (second field), with automatic field separation by whitespace or custom delimiters using the -F option
- Common usage examples: gawk ‘{print $1, $3}’ file.txt to print specific columns, or gawk -F: ‘{print $1}’ /etc/passwd to extract usernames from the passwd file using colon as field separator
15- After booting, what command should you use to look for any errors that occurred during the boot process?
- fsck
- init
- mount
- dmesg
- mkinitrd
dmesg
Errors that occur while the Linux system is booting are sent to the kernel ring buffer. The dmesg program allows you to view the entries in the kernel ring buffer, making option D correct. The fsck program allows you to find and fix errors on a partition but doesn’t allow you to view errors as they occur during boot time, making option A incorrect. The init process starts processes during boot time but doesn’t allow you to view any errors generated, so option B is incorrect. The mount program allows you to mount a partition into the virtual directory but not view any errors that occurred during boot time, so option C is incorrect. The mkinitrd program creates a virtual directory that’s loaded into memory during boot time, but doesn’t allow you to view any errors that are generated, so option E is incorrect.
19- You are troubleshooting a systemd system and issue the command systemctl is-system-running. The command displays degraded. Which of the following best describes what is going on?
- The system is fully in working order.
- The system has one or more failed units.
- The system is in emergency mode.
- The system is in recovery mode.
- The system is starting to shut down.
The system has one or more failed units.
When the systemctl is-system-running command displays degraded, this means that the system has one or more failed units, such as a service or a socket. Therefore, option B is the correct answer. If the system was fully in working order, the command would display the running status. Thus, option A is a wrong answer. If the system was in emergency or recovery mode, the command would display the maintenance status. Therefore, both options C and D are wrong choices. If the system was starting to shut down, the command would display the stopping status. Thus, option E is also an incorrect choice.
20- Which of the following sections would you find in a systemd service unit file? (Choose all that apply.)
- [Unit]
- [Automount]
- [Mount]
- [Service]
- [Install]
- [Unit]
- [Service]
- [Install]
You would find three sections in a systemd service unit file. They are [Unit], [Service], and [Install]. Therefore, options A, D, and E are correct answers. The [Automount] section is only in systemd automount unit files. Thus, option B is a wrong answer. The [Mount] section is only in systemd mount unit files, and therefore, option C is also an incorrect choice.
21- You are troubleshooting a rather serious problem on a systemd server. Using super user privileges, you enter the systemctl isolate emergency command. Once you are logged back into the system, you issue the systemctl is-system-running command. What is displayed?
- yes
- true
- false
- emergency
- maintenance
maintenance
When you jump to the emergency target, issuing the systemctl is-system-running command will display the maintenance status. Therefore, option E is the correct answer. The other items are not displayed by the systemctl is-system-running command at any time, so therefore, options A, B, C and D are all incorrect choices.
22- You are auditing an old SysVinit system and checking the status of each service that runs on the system. When you decide to check the DHCP service, using the command chkconfig dhcp on the command line, you get no response. What does this mean?
- The DHCP service is not running.
- The DHCP service either is not running or has failed.
- You need to issue an additional command.
- You need to issue a different command.
- The DHCP service program files are not installed.
You need to issue an additional command.
When you issued the chkconfig command and pass it a service name, the command will check if the service is enabled at the current runlevel. However, it does not display the results to STDOUT. Instead the results, true (0) or false (1), are sent to the ? variable. Therefore, you need to issue an additional command to see the results, which is echo $?. Therefore, option C is the correct answer. The ckconfig dhcp command does not determine if the DHCP service is running or not, or failed, so options A and B are wrong answers. You do not need to issue a different command, just an additional command, so option D is a wrong choice. Also, the command’s primary purpose is to determine whether or not the service is enabled at the current runlevel, so option E is an incorrect choice.
23- What network settings does the ip command set? (Choose all that apply.)
- IP address
- Subnet mask
- Default router
- DNS servers
- NTP servers
- IP address
- Subnet mask
- Default router
Explanation
The ip command allows you to set the IP address, subnet mask, and default router for a network interface, making options A, B, and C correct. It doesn’t allow you to set the DNS or NTP servers for a connection, making options D and E incorrect.