Wiley Quiz Questions Flashcards
Which web server is used in the popular LAMP stack?
Apache
A ________ runs in background and listens for client connection requests for a single application.
Daemon
Which open-source database provided fast performance and became a popular choice for web applications?
MySQL
How does a server know what client request is sent to which application daemon?
Ports
What popular open source web server can also perform as a load balancer?
nginx
The nginX web server can also perform as a load balancer and send client requests to multiple backend web servers
What format does MongoDB use to store data elements in the database?
JSON
Which part of the Linux mail process is responsible for sending emails to remote hosts?
MTA
The MTA package is responsible for connecting with remote mail hosts to deliver email messages
Which part of the Linux mail process allows you to create filters to automatically redirect incoming mail messages?
MDA
The MDA allows you to create filters to match email messages to redirect to other folders
What protocol should you use to mount folders from remote Linux servers on your local Linux server?
NFS
The NFS protocol is used to share folder areas on the network with clients
The ________ software package allows your Windows workstations to mount a folder stored on a Linux server.
Samba
Which two software packages are used in Linux to maintain log files?
rsyslogd
journald
Which software program should you load on your Linux server to synchronize its time with a standard time server?
ntpd
What software package allows a Linux server to print to a network printer?
CUPS
If you see the named program running in background on your Linux server, what service does it provide?
Hostname resolution
Which authentication package used to be called by the name “Yellow Pages”?
NIS
What package do you need to install to allow your Linux server to provide IP addresses to clients on your local network?
DHCPd
The _______ package allows you to create a secure tunnel across a private network to access your local network remotely.
OpenSSH
The OpenSSH package allows you to use certificates to establish a secure connection between two devices on the network
What server role should you implement to block your local network clients from accessing sports websites during business hours?
A web proxy
A web proxy server allows you to intercept client web requests and block any requests based on rules you define
What server role should you implement to increase performance on your company’s website?
A load balancer
A _______ allows your developers to easily deploy applications between development, test, and production.
A container
You are looking at a directory that you have not viewed in a long time and need to determine which files are actually directories. Which command is the best one to use?
ls -F
append an indicator code of / to every directory name, so therefore it is the best choice
You are using the ls command to look at a directory file’s metadata but keep seeing metadata for the files within it instead. What command option will rectify this situation?
-d
The -d switch on the ls command will allow you to view a directory file’s metadata instead of seeing metadata for the files managed by that directory
You have just created an empty directory called MyDir. Which command most likely did you use?
mkdir -v MyDir
The mkdir -v command creates a directory and lets you know whether or not it was successful
You have a file that is over 10GB in size, and it needs to be backed up to a locally attached drive. What is the best utility to use in this situation?
The rsync utility allows you to perform fast local copies, so for a big file it is the best utility to use in this case
A long-time server administrator has left the company, and now you are in charge of her system. Her old user account directory tree, /home/Zoe/, has been backed up. Which command is the best one to use to quickly remove her files?
rm -rI /home/Zoe
The rm -rI command will recursively delete the files in the /home/Zoe directory tree, and it will ask before it starts, so you know you are deleting the correct tree
There is a large directory structure that needs to be renamed. What mv command options should you consider employing?
-I -n -v
When renaming a directory, you only need to employ the mv command. However, it is wise to use the -i option, so if the new directory name already exists, the utility will stop and ask permission prior to proceeding. Even better is to use the -n option; that way, if the new name you select is already being used, the mv command does not allow you to overwrite it. Also, the -v option is worthwhile, so the mv command operates in verbose mode, telling you want is going on
You are trying to decide whether to use a hard link or a symbolic link for a data file. The file is 5GB, has mission-critical data, and is accessed via the command line by three other people. What should you do?
Create three hard links and provide the links to the three other people for data protection
The hard links will prevent the three other command-line interface users from accidentally deleting the data. If they delete their link’s name, they will not delete the data
A short text-based control file is no longer working properly with the program that reads it. You suspect the file was accidentally corrupted by a control code update you performed recently, even though the file’s control codes are all correct. Which command should you use next on the file in your problem investigation?
cat -v
The cat -v command will show any nonprinting characters that may have gotten embedded in the control file causing it to be corrupt
You have two short text files that have maximum record lengths of 15 characters. You want to review these files side by side. Which of the following commands would be the best to use?
pr -mtl 20
the best command to use is the pr -mtl 20 command. This will display the files side by side, remove any file headers or trailers, and set the page length to 20 lines so the files do not scroll off your screen. Of course, you may need to adjust the line length depending upon your screen’s resolution
You have a lengthy file named, FileA.txt. What will the head -15 FileA.txt command do?
Display the first 15 lines of the file
The head command can use either the -n 15 switch or the -15 switch to display a file’s first 15 lines
You have issued the command grep Hal on a text file you generated using information from a failed login attempts file. It returns nothing, but you just performed a test case, by purposely failing to log into the Hal account, prior to generating the text file. Which of the following is the best choice as your next step?
It is possible that the account name Hal is listed in the generated text file as hal. Therefore, your best next step is to employ the -i option on the grep command. This will quickly search the text file for the word Hal, while ignoring case
You are trying to peruse a rather large text file. A coworker suggests you use a pager. Which of the following best describes what your coworker is recommending?
A pager utility allows you to view one text page at a time and move through the text at your own pace
Which of the following does not describe the less utility?
You need to use the q key to exit from the less pager utility
Which diff option is the best option to allow you to quickly determine if two text files are different from one another?
The -q (or –brief) option used with the diff command will allow you to quickly determine if two text files are different from one another.
You are working on a Linux server at the command line, and you try to issue a diff command and receive a response stating that the command was not found. What is the next best step to take in order to start the troubleshooting process?
Enter the which diff command
the which command will allow you to quickly see the location of the program you provide as an argument. If you see no response, you can go on to the next troubleshooting step of determining if the program is not installed
You are trying to find a file on your Linux server whose name is conf. Employing the locate conf command for your search shows many directories that contain the letters conf. What is the best description for why this is happening?
By default, the locate command uses file globbing, which adds wildcards to the pattern you enter. Thus, conf is turned into conf
You downloaded a large important file, fortytwo.db, from your company’s local website to your Linux server but got interrupted by an emergency. Now you cannot remember where you stored the file. What is the best first step to fixing this problem?
Issue the sudo updatedb command
The locate utility searches the mlocate.db database, which is typically only updated one time per day via a cron job. Therefore, for this newly created file, the first thing you should do is update the mlocate.db via the updatedb command, using super user privileges
You want to search for a particular file, main.conf, using the find utility. This file most likely is located somewhere in the /etc/ directory tree. Which of the following commands is the best one to use in this situation?
find /etc -name main.conf
When using the locate command, the path argument is listed first, which is a starting point directory. The find utility will search through that directory and all its subdirectories (recursively) for the file or files you seek. Also, the -name switch allows you to search for a file by name
Yesterday a coworker, Michael, was fired for nefarious behavior. His account and home directory were immediately deleted. You need to audit the server to see if he left any files out in the virtual directory system. Which of the following commands is the best one to use in this situation?
find / -nouser
The find / -nouser command will search through the entire virtual directory structure looking for any files that do not have a username associated with them. Since Michael’s account and home directory were deleted, any files he owned out in the virtual directory structure will not have a username associated with them, only a user ID (UID)
You need to figure out what configuration file(s) hold a host name directive. Which of the following commands is the best one to use?
grep
The grep utility will allow you to search file contents quickly and effectively
The cat -E MyFile.txt command is entered, and at the end of every line displayed is a $. What does this indicate?
A text file record is considered to be a single file line that ends in a newline linefeed that is the ASCII character LF. You can see if your text file uses this end-of-line character via the cat -E command
The cut utility often needs delimiters to process text records. Which of the following best describes a delimiter?
To properly use some of the cut command options, fields must exist within each text file record. These fields are data that is separated by a delimiter, which is one or more characters that create a boundary between different data items within a record
Which of the following utilities change text within a file?
Recall that many utilities that process text do not change the text within a file unless redirection is employed to do so. The only utilities in this list that will allow you to modify text include the text editors vim and nano
You have a text file, monitor.txt, which contains information concerning the monitors used within the data center. Each record ends with the ASCII LF character and fields are delimitated by a comma (,). A text record has the monitor ID, manufacture, serial number, and location. To display each data center monitor’s monitor ID, serial number, and location, use which cut command?
The cut command gathers data from the text file, listed as its last argument, and displays it according to the options used. To define field delimiters as a comma and display each data center monitor’s monitor ID, serial number, and location, the options to use are -d “,” -f 1,3,4. Also, since the text file’s records end with an ASCII LF character, no special options, such as the -z option, are needed to process these records
The grep utility can employ regular expressions in its PATTERN. Which of the following best describes a regular expression?
a regular expression is a pattern template you define for a utility, such as grep, which uses the pattern to filter text
You are a system administrator on a CentOS Linux server. You need to view records in the /var/log/messages file that start with the date May 30 and end with the IPv4 address 192.168.10.42. Which of the following is the best grep command to use?
grep “May 30.*192.168.10.42” /var/log/messages
It uses the quotation marks around the pattern to avoid unexpected results and uses the .* regular expression characters to indicate that anything can be between May 30 and the IPv4 address. No additional switches are necessary
Which of the following is a BRE pattern that could be used with the grep command?
Sp?ce
“Space, the .*frontier”
^Space
frontier$
You need to search through a large text file and find any record that contains either Luke or Laura at the record’s beginning. Also, the phrase Father is must be located somewhere in the record’s middle. Which of the following is an ERE pattern that could be used with the egrep command to find this record?
”(^Luke|^Laura) .Father is.”
A file data.txt needs to be sorted numerically and its output saved to a new file newdata.txt. Which of the following commands can accomplish this task?
To sort the data.txt file numerically and save its output the new file, newdata.txt, you can either use the -o switch to save the file or employ standard output redirection via the > symbol. In both cases, however, you need to use the -n switch to properly enact a numerical sort
Which of the following commands can display the data.txt and datatoo.txt files’ content one after the other to STDOUT? (Choose all that apply.)
cat -n data.txt datatoo.txt
sort data.txt datatoo.txt
A text file, StarGateAttacks.txt, needs to be specially formatted for review. Which of the following commands is the best command to accomplish this task quickly?
The pr command’s primary purpose in life is to specially format a text file for printing, and it can accomplish the required task fairly quickly
You need to format the string 42.777 into the correct two-digit floating number. Which of the following printf command FORMAT settings is the correct one to use?
The printf FORMAT “%.2f\n” will produce the desired result of 42.78
A Unicode encoded text file, MyUCode.txt, needs to be perused. Before you decide what utility to use in order view the file’s contents, you employ the wc command on it. This utility displays 2020 6786 11328 to STDOUT. What of the following is true?
The file has 2,020 lines in it
The file has 6,786 words in it
Which of the following best defines a file descriptor?
A file descriptor is a number that represents a process’s open files
By default, STDOUT goes to what item?
By default, STDOUT goes to your current terminal, which is represented by the /dev/tty file
Which of the following commands will display the file SpaceOpera.txt to output as well as save a copy of it to the file SciFi.txt?
cat SpaceOpera.txt | tee SciFi.txt
Which of the following commands will put any generated error messages into the black hole?
sort SpaceOpera.txt 2> /dev/null
The /dev/null file is also called the black hole, because anything you put into it cannot be retrieved. If you do not wish to see any error messages while issuing a command, you can redirect STDERR into it
Which of the following commands will determine how many records in the file Problems.txt contain the word error?
grep error Problems.txt | wc -1
To find records within the Problems.txt file that contain the word error at least one time, the grep command is employed. The correct syntax is grep error Problems.txt. To count the records the grep command’s STDOUT is piped as STDIN into the wc utility. The correct syntax to count the records, is wc -l
You want to find any file named 42.tmp, which exists somewhere in your current directory’s tree structure and display its contents to STDOUT. Which of the following will allow you to build a command to do this?
The xargs command, $() method, backticks (`), and brace expansion all allow you to build a command-line command on the fly. In this case, only options B, C, and E are using the correct command syntax to find any file named 42.tmp, which exists somewhere in your current directory’s tree structure and display its contents to STDOUT. Therefore, options B, C, and E are correct answers
You want to edit the file SpaceOpera.txt and decide to use the vim editor to complete this task. Which of the following are vim modes you might employ?
The three modes of the vim editor are command (also called normal mode), insert (also called edit or entry mode), and ex (sometimes called colon commands) mode. Therefore, options A, C, D, and E are correct answers
What program does the workstation firmware start at boot time?
The workstation firmware looks for the bootloader program to load an operating system
Where does the firmware first look for a Linux bootloader program?
The workstation firmware looks at the first sector of the first hard drive to load the bootloader program. This is called the Master Boot Record
The ______ command allows us to examine the most recent boot messages?
The kernel ring buffer, which you can view by typing dmesg, contains messages from the boot messages from the kernel
What folder do most Linux distributions use to store boot logs?
Most Linux distributions store boot log files in the /var/log folder
Where does the workstation BIOS attempt to find a bootloader program?
The BIOS firmware can look in multiple locations for a bootloader program. Most commonly it looks at the internal hard drive installed on the system, but if none is found, it can search other places. Most workstations allow you to boot from an external hard drive or from a DVD drive. Modern workstations now also provide the option to boot from a USB memory stick inserted into a USB port on the workstation. Finally, many workstations provide the PXE boot option, which allows the workstation to boot remotely from a network server.
Where is the Master Boot Record located?
The Master Boot Record (MBR) is located in only one place, on the first sector of the first hard drive on the workstation
The EFI System Partition (ESP) is stored in the _______ directory on Linux systems
The ESP is stored in the /boot/efi directory on Linux systems. The UEFI firmware always looks for the /boot/efi directory for bootloader programs
What filename extension do UEFI bootloader files use?
The UEFI specification doesn’t require a specific extension for UEFI bootloader files. However, it has become common in Linux to use the .efi filename extension to identify them
Which was the first bootloader program used in Linux?
The Linux Loader (LILO) bootloader program was the first bootloader used in Linux
Where are the GRUB Legacy configuration files stored?
The GRUB Legacy configuration files are stored in the /boot/grub directory
Where are GRUB2 configuration files stored?
The GRUB2 bootloader stores configuration files in both the /boot/grub directory and the /etc/grub.d directory
You must run the ______ command to generate the GRUB2 grub.cfg configuration file
The grub-mkconfig command combines the configurations defined in the /etc/default/grub file and all files in the /etc/grub.d folder into a single grub.cfg configuration file