11.5.8 Practice Questions

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

You're using the vi editor to manage a text file on a Linux system. You want to type new text into the file. When you type, you want the existing text that comes after the cursor to be pushed down. Which mode provides this function? Text Mode Command Line Mode Command Mode Insert Mode Replace Mode

Insert Mode EXPLANATION In the vi editor, you need to switch to Insert Mode to be able to type new text in the file and have existing text that comes after the cursor pushed down. In Replace Mode, the existing text that comes after the cursor would be replaced when you typed new text. In Command Line Mode, you can enter commands to save the file and exit, exit the file without saving, save the file with a new name, etc. In Command Mode, you can perform many useful editing tasks in this mode, such as cut and paste, copy and paste, deleting text, etc. There is no Text Mode in vi.

You've just opened a text file in the vi editor, and you're in Command Mode by default. There is more than one way to get from Command Mode to Replace Mode. Which of the following key-press sequences will get you into Replace Mode? (Select THREE).

Press the S key and then press Insert Press the 'i' key and then press Insert Press Insert and then press Insert again EXPLANATION In Command Mode, you need to press either the I key, the S key, or the Insert key to enter Insert Mode; then, just as with GUI word processors, if you press the Insert key again, the cursor will change to Replace Mode. Pressing Esc while in Command Mode will switch vi to Command Line Mode.

You need to see what kind of CPU is being used on a Linux system. The /proc directory contains a text file called cpuinfo that will give you the information you are looking for. Which of the following commands will display the entire contents of the cpuinfo text file on the screen?

cat /proc/cpuinfo EXPLANATION Using the cat command will display the entire contents of a text file on the screen. The vi command opens text files in the vi editor. The grep utility is used to inspect the contents of a file to find lines that match a specified search term.

A technician attempts to run an executable file on a Linux computer and receives a Permission Denied message. Which of the following command should the technician use? ls ps chmod grep

chmod EXPLANATION The chmod command modifies the permissions on a files and defines who can access a file and the mode that can be used to access a file. The grep command is used to search text. The technician could save the output of the ps command in a text file and then search the files, or the technician could pipe the output from the ps command into the grep command. The ls command list the contents of a directory. The ps command lists information on the running processes on a Linux computer.

A technician uses the ps command to find information about a process that is running a browser application on a Linux computer. The technician knows the name of the process, but the list is very long. Which of the following commands would help the technician find and display only the information about the browser process? cd grep ls sudo

grep EXPLANATION The grep command is used to search text. The technician could save the output of the ps command in a text file and then search the files, or the technician could pipe the output from the ps command into the grep command. The ls command list the contents of a directory. The cd command is used to change the current directory, or the directory in which the user is currently working. The sudo command is short for "superuser do" or "substitute user do." It allows a user with proper permissions to execute a command as another user, such as a superuser.

You need to view the contents of /var/log/auth.log to get information about the users that have been logging on to the system. The auth.log file is a plain text, file so you decide to use the cat command to review the file. However, the display fills with text for several pages, and you can't see the entire file. What commands can you use to view the content of the auth.log file page by page? (Select TWO).

less /var/log/auth.log more /var/log/auth.log EXPLANATION Using the more command, the contents of the file is output to the screen one page at a time to give you a chance to read the contents of the file; press the space bar to go through the file one page at a time. Using the less command does the same thing as the more command, except that is allows you to use the Pg Up and Pg Dn keys to scroll up and down through the file.

You are the administrator for a Linux server. Following best practices for system security and effective administration, you always log in to the system with a standard non-root user account. You only elevate your privileges to root user level when you need to do an administrative task. What do you enter at the command prompt that will, by default, switch you to the root user and require you to enter the root password?

su - EXPLANATION At the command prompt, enter su -, and the system will switch you to the root user and require you to enter the root password. You will then be able to perform tasks that require root user administrative privileges. After completing these tasks, you should log out as root and return to the standard user account.


Kaugnay na mga set ng pag-aaral

Joints-structural classification, structural/functional classification of joints classification of movements,exam 3

View Set

ITM 350- Chapter 10 quiz study guide

View Set

EMT Chapter 33: Obstetrics and Neonatal Care

View Set

Chapter 12 - Restraint Alternatives and Safe Restraint Use (textbook)

View Set

Chapter 14: Eating Disorders: Risk to Nutrition

View Set