2.0 Systems Operation and Maintenance Flashcards

1
Q

Describe the ways to start server programs in Linux

A

Server Programs in Linux can either run continually in the background as a daemon process or be started from a super-server daemon when requested by a client

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do clients know how to contact a server program?

A

Server applications listen for client connections on well-known ports. Clients must send a connection requests to the server on the well-known port for the application they want to interact with

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the commonly used components in the LAMP stack?

A

The LAMP stack uses the Linux operating system, the Apache web server, the MYSQL database server, and the PHP programming language to provide a platform for web applications

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are some ways a Linux server can share files in a local network?

A

Linux servers can use the nfs-utils package to communicate with other Linux servers to share folders using NFS.

The local Linux server can mount folders from the remote Linux server as if they were local disks.

Linux servers can also use the Samba package to share files on Windows local networks with Window client and servers as well as map folders on Windows servers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which server packages are commonly used to support network features on a local network?

A

The DHCPd package provides DHCP server services to assign IP addresses to clients. The BIND package provides DNS server services to both clients and servers on a local network for hostname resolution. The net-snmp package allows you to implement remote device management using SNMP, and you can use the ntpd package to create an NTP time server for the local network

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you create a network directory server using Linux?

A

The OpenLDAP package allows you to create an LDAP directory of users and devices on the local network. Clients and other servers can use the LDAP directory to authenticate users and devices on the network

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How can you improve the performance of a network application?

A

For network applications in a high-volume environment, you can improve performance by implementing either a cluster or load balancing environment.

In a cluster, you can split application functions between multiple servers by using cluster package such as Apache Hadoop.

With load balancing, you can distribute client connections between multiple servers using packages such as HAProxy and Linux Virtual Server (LVS)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What web server is used in the popular LAMP stack?

A

Apache

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

A _____ runs in background and listens for client connection requests for a single application

A

daemon

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which open-source database provided fast performance and became a popular choice for web applications?

A

MYSQL Database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How does a server know what client request is sent to which application in a daemon?

A

Linux services listen own well-known ports for requests from clients

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What popular open source web server can also perform as a load balancer

A

The nginX web server can also perform as a load balancer and send client requests to multiple backend web servers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What format does MongoDB use to store data elements in the database?

A

The MongoDB database server uses the JSON format for storing data records

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which part of the Linux mail process allows you to create filters to automatically redirect incoming mail messages?

A

The MDA allows you to create filters to match email messages to redirect to other folders

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What protocol should you use to mount folders from remote Linux servers on your local Linux server?

A

The NFS protocol is used to share folder areas on the network with clients

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

The ______ software package allows your windows workstations to mount a folder stored on a Linux server

A

The Samba software package allows a Linux server to communicate with Windows servers and clients using the SMB protocol

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What two software packages are used in Linux to maintain log files?

A

The rsyslogd program is used by SysV init systems to log events, and the journald program is used by Systemd systems to log events

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Which software program should you load on your Linux server to synchronize its time with a standard time server?

A

The ntpd service uses NTP to synchronize the server time with a remote system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What software package allows a Linux server to print to a network printer?

A

The CUPS application provides printer drivers and services that allow Linux systems to connect with local and remote printers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

If you see the named program running in background on your Linux server, what service does it provide?

A

The named program is part of the BIND application, which provides hostname resolution services

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Which authentication packages used to be called by the name “Yellow Pages”?

A

The NIS package was formerly called Yellow Pages (YP), but the name had to be changed due to trademark issues

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What package do you need to install to allow your Linux server to provide IP addresses to clients on your local network?

A

The DHCPd program provides DHCP server services on a local network

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

The _____ package allows you to create a secure tunnel across a private network to access your local network remotely

A

The OpenSSH package allows you to use certificates to establish a secure connection between two devices on the network

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What server role should you implement to increase performance on your company’s website?

A

A web proxy server allows you to intercept client web requests and block any requests based on rules you define

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

A _____ allows your developers to easily deploy applications between development, test, and production

A

A container allows developers to develop applications in a controlled environment that can easily be deployed to other servers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

Which part of the Linux mail process is responsible for sending emails to remote hosts?

A

The MTA package is responsible for connecting with remote mail hosts to deliver email messages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

What are some typical base file and directory management activities?

A

The typical basic file and directory management activities include viewing and creating file, copying and moving files, and deleting files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

What commands are used for viewing and creating files in directories?

A

The ls, touch, and mkdir commands

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

What commands should you use when you need to duplicate, rename, or move files?

A

Use one of the mv, cp. or rsync commands

For local large file copies, the rsync utility is typically the fastest. You can quickly delete an empty directory using the rmdir utility, but for directories full of files, you will need to use the rm -r command. Also, if you need to ensure that you are removing the correct files, be sure to use the -i option on the rm utility

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

Describe both structures and commands involved in linking files

A

Linking files is rather easy to do with the ln command. However, it is important for you to describe the underlying link structure. Hard linked files share the same inode number, while soft linked files do not. Soft or symbolic links can be broken if the file they link to is removed. It is also useful to understand the readlink utility to help you explore files that have multiple links

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

What are various utilities that can be employed to read text files?

A

To read entire text files, you can use the cat, bat, and pr utilities. Each utility has its own special features. If you only need to read the first or last lines of a text file, employ either the head or tail command. For a single text line out of a file, the grep utility is useful. For reviewing a file a page at a time, you can use either the less or the more pager utility.

32
Q

Describe how to find information on your Linux system

A

To determine two text files’ differences, the diff utility is helpful. With this utility, you can also employ redirection and modify the files to make them identical. When you need to quickly find files on your system and want to use simple tools, the which, whereis, and locate commands will serve you well. Keep in mind that the locate utility uses a database that is typically updated only one time per day, so you may need to manually update it via the updatedb command. When simple file location tools are not enough, there are more complex searching utilities, such as find and grep. The grep command can employ regular expressions to assist in your search

33
Q

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?

A

ls -F

will append an indicator code of / to every directory name

34
Q

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?

A

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

35
Q

You have just created an empty directory called MyDir. Which command most likely did you use?

A

The mkdir -v command creates a directory and lets you know whether or not it was successful

36
Q

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?

A

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

37
Q

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?

A

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

rm -rI /home/Zoe

38
Q

There is a large directory structure that needs to be renamed. What mv command options should you consider employing?

A

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

39
Q

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?

A

Create three hard links and provide the links to the three other people for data protection.

because the hard links will prevent the three other command-line interface users from accidently deleting the data. If they delete their link’s name, they will not delete the data

40
Q

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?

A

The cat -v command will show any nonprinting characters that may have gotten embedded in the control file causing it to be corrupt

41
Q

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?

A

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

42
Q

You have a lengthy file named, FileA.txt. What will the head -15 FileA.txt command do?

A

The head command can use either the -n 15 switch or the -15 switch to display a file’s first 15 lines

43
Q

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?

A

Issue the grep -i Hal command on the text file

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

44
Q

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

Use a utility that allows you to view one text page at time

A pager utility allows you to view one text page at a time and move through the text at your own pace

45
Q

What describe the less utility?

A

It does not read the entire file prior to displaying the file’s first page.
You can use the up and down arrow keys to move through the file.
You press the spacebar to move forward a page.
You can use the Esc+V key combination to move backward a page.

46
Q

Which diff option is the best option to allow you to quickly determine if two text files are different from one another?

A

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.

47
Q

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?

A

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

48
Q

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?

A

It is due to file globbing on the pattern name

By default, the locate command uses file globbing, which adds wildcards to the pattern you enter. Thus, conf is turned into conf

49
Q

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?

A

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

50
Q

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?

A

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

51
Q

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?

A

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)

52
Q

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?

A

The grep utility will allow you to search file contents quickly and effectively

53
Q

What utilities can be used to filter text file data?

A

Filtering text file data can be made much easier with utilities such as grep, egrep, and cut

54
Q

How can you format data for viewing purposes?

A

To format it for viewing use sort, pr, printf, or even the cat utility

55
Q

What command can you use for statistical information on a file?

A

If you need some statistical information on your text file, such as the number of lines it contains, the wc command is handy

56
Q

Explain both the structures and commands for redirection

A

Employing STDOUT, STDERR, and STDIN redirection allows rather complex filtering and processing of text. The echo command can assist in this process as well as here documents. You can also use pipelines of commands to perform redirection and produce excellent data for review

57
Q

Describe the various methods used for editing text files

A

Editing text files is part of a system administrator’s life. You can use full-screen editors such as the rather complicated vim text editor or the simple and easy-to-use nano editor. For fast and powerful text stream editing, employ the use of sed and its scripts or the gawk programming language.

58
Q

The cat -E MyFile.txt command is entered, and at the end of every line displayed is a $. What does this indicate?

A

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

59
Q

The cut utility often needs delimiters to process text records. Which of the following best describes a delimiter?

A

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

60
Q

Which of the following utilities change text within a file?

A

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

61
Q

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?

A

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

cut -d “,” -f 1,3,4 monitor.txt

62
Q

The grep utility can employ regular expressions in its PATTERN. Which of the following best describes a regular expression?

A

A pattern template you define for a utility, which uses the pattern to filter text

a regular expression is a pattern template you define for a utility, such as grep, which uses the pattern to filter text. While you may use a series of characters in a grep PATTERN, they are not called regular expressions

63
Q

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?

A

grep “May 30.*192.168.10.42” /var/log/messages

this grep command employs the correct syntax. 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

64
Q

Which of the following is a BRE pattern that could be used with the grep command? (Choose all that apply.)

A

Sp?ce
“Space, the .*frontier”
^Space
frontier$

A BRE is a basic regular expression that describes certain patterns you can use with the grep command

65
Q

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?

A

”(^Luke|^Laura).Father is.

66
Q

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?

A

sort -n -o newdata.txt data.txt

sort -n data.txt > newdata.txt

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

67
Q

Which of the following commands can display the data.txt and datatoo.txt files’ content one after the other to STDOUT?

A

cat -n data.txt datatoo.txt

sort data.txt datatoo.txt

The commands in both options C and E will display the data.txt and datatoo.txt files’ content one after the other to STDOUT. The cat -n command will also append line numbers to it, but it will still concatenate the files’ content to standard output

68
Q

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?

A

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

69
Q

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?

A

The printf FORMAT “%.2f\n” will produce the desired result of 42.78

70
Q

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?

A

The file has 2,020 lines in it

The file has 6,786 words in it

The first item output by the wc utility is the number of lines within a designated text file. Therefore, option A is correct. Option C is also correct, because the second item output by the wc utility is the number of words within a designated text file

71
Q

What is a file descriptor?

A

A file descriptor is a number that represents a process’s open files

72
Q

By default, STDOUT goes to what item?

A

By default, STDOUT goes to your current terminal, which is represented by the /dev/tty file

73
Q

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?

A

cat SpaceOpera.txt | tee SciFi.txt

The command in option A will display the SpaceOpera.txt file to output as well as save a copy of it to the SciFi.txt file

74
Q

Which of the following commands will put any generated error messages into the black hole?

A

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.

75
Q

Which of the following commands will determine how many records in the file Problems.txt contain the word error?

A

grep error Problems.txt | wc -l

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

76
Q

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?

A

cat find . -name 42.tmp
cat $(find . -name 42.tmp)
find . -name 42.tmp | xargs cat

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

77
Q

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?

A

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)