OpieTaylor
Quiz por , criado more than 1 year ago

Review Questions for Chapter 3: Mastering Editors

814
1
0
OpieTaylor
Criado por OpieTaylor aproximadamente 10 anos atrás
Fechar

Chapter 3 Review Questions

Questão 1 de 25

1

You are using vi to edit a file and have just entered 12 new lines. You need to replicate the same 12 lines right after you enter them. What command-mode command can you type to replicate the lines?

Selecione uma das seguintes:

  • a period (.)

  • Ctrl+r

  • Ctrl+R

  • a dollar sign ($)

Explicação

Questão 2 de 25

1

Which of the following enables you to move the cursor to the left while you are in command mode in the vi editor?

Selecione uma ou mais das seguintes:

  • Press the right arrow key.

  • Press the left arrow key.

  • Press h.

  • Press l.

Explicação

Questão 3 de 25

1

When you started the vi editor, you forgot to specify the name for the new file you are creating. To save steps next time, how can you specify the name of a new file when you first start vi?

Selecione uma das seguintes:

  • Enter vi -n at the command line and then type in the file name when prompted.

  • Enter vi -n and the filename, such as vi -n myfile.

  • Enter vi and the filename, such as vi myfile.

  • Enter vi ? and then enter the file name when you see the > prompt on the command line.

Explicação

Questão 4 de 25

1

Your colleague has written a line of text in vi and now wants to delete the line, but save its contents in a buffer in case he decides to bring back the line he deletes. What do you recommend?

Selecione uma das seguintes:

  • While in command mode, move the cursor to the last character in the line and press d-.

  • While in insert mode, move the cursor to any character in the line and press Alt+d.

  • While in command mode, move the cursor to the first character in the line and press dd.

  • While in insert mode, move the cursor to the last character in the line and type :#delete.

Explicação

Questão 5 de 25

1

You are in the vi editor and it’s now noon. Every day at noon you run a program called update, which updates a database. How can you run the program without closing your vi session?

Selecione uma das seguintes:

  • From command mode, press #, type update, and press Enter.

  • From insert mode, press Alt+ and then type update.

  • From insert mode, press && twice and then type update.

  • From command mode, type :!update and press Enter.

Explicação

Questão 6 de 25

1

While you are working on a report in vi, you decide to insert information from another file. Provide the command sequence to insert a file called employees.txt into your current vi session. Assume you are in command mode.

Selecione uma das seguintes:

  • :r employees.txt

  • +employees.txt

  • add employees.txt

  • #copy employees.txt

Explicação

Questão 7 de 25

1

You’re editing a document using vi and you are near the end of a page. You want to quickly go back to the top of the page to check something you said. Which of the following command-line commands enables you to quickly go to the top of the page?

Selecione uma das seguintes:

  • :top

  • T

  • Go1

  • H

Explicação

Questão 8 de 25

1

You are preparing to give a training session on the vi editor. How would you BEST describe it?

Selecione uma ou mais das seguintes:

  • It is modal.

  • It is a text editor.

  • Most UNIX/Linux distributions come with vi.

  • It is a screen editor.

Explicação

Questão 9 de 25

1

While working in the Emacs editor, you delete a section of text and then decide to undo your deletion. Which of the following commands should you use?

Selecione uma das seguintes:

  • Use the Ctrl+u command.

  • Use the Alt+u command.

  • Use the Ctrl+x,u command.

  • You're stuck retyping the deleted text, because Emacs does not enable you to undelete.

Explicação

Questão 10 de 25

1

When you copy text in Emacs, you must mark the text you want to copy by using which of the following commands?

Selecione uma das seguintes:

  • Use Ctrl+Tab to mark the beginning of the text and Ctrl+Shift to mark the end. Next press Alt+z to copy the text.

  • Use Ctrl+Spacebar to mark the beginning of the text and Alt+w to mark the end as well as to copy the text.

  • Use :mark to mark the beginning of the text and :endmark to mark the end as well as to copy the text.

  • Use @begin to mark the beginning of the text and @end to mark the end. Next type :copy to copy the text.

Explicação

Questão 11 de 25

1

You’ve used Emacs to write advertising copy about a new software product your company has developed. Now you find out that the name of the product has been changed slightly. What command can you use to track down all references to the old name so you can locate them?

Selecione uma das seguintes:

  • Press Ctrl+s.

  • Press Alt+f.

  • Type :find.

  • Type #locate.

Explicação

Questão 12 de 25

1

How can you find out information about the status of an editing session while in the vi editor?

Selecione uma das seguintes:

  • Type :status while in command mode.

  • Press Ctrl+? while in insert mode.

  • Press Ctrl+g while in command mode.

  • Press the Spacebar twice while in command mode.

Explicação

Questão 13 de 25

1

You are using the vi editor to create a list of tasks on each line and you would like an easy way to number each line (task) listed in the file. Describe how you would display the line numbers while in vi.

Selecione uma das seguintes:

  • Press Alt+F2 to turn on automatic numbering for text.

  • When you first start vi from the command line, type vi -n.

  • Enter the number 1 plus a period at the beginning of the first line, and then each new line will be numbered automatically.

  • From command mode, enter :set number.

Explicação

Questão 14 de 25

1

You have been working on a long vi text file and now you’ve got to rush off to a meeting. How can you quickly save your work and exit the vi editor?

Selecione uma ou mais das seguintes:

  • From command mode, enter :wq.

  • From command mode, enter :ZZ.

  • From command mode, enter :bye.

  • From command mode, enter :x.

Explicação

Questão 15 de 25

1

While editing a file in vi, you realize you have been spelling the word 'receive' as 'recieve'. How can you find all occurrences of your misspelled 'receive'?

Selecione uma das seguintes:

  • From command mode, type /recieve and press Enter.

  • From insert mode, type Alt+r and enter recieve.

  • From command mode, press F4 and enter recieve.

  • From insert mode, press F7 and enter recieve.

Explicação

Questão 16 de 25

1

As you look over the shoulder of an employee who is using the vi editor, you see her use the command :l $s/capitol/capital. What does this command do?

Selecione uma das seguintes:

  • It converts all letters to capitals in the file.

  • It changes all instances of capitol to capital.

  • It searches to ensure that each sentence starts with an uppercase letter.

  • It finds the last instance of capital and changes it to Capitol

Explicação

Questão 17 de 25

1

You have just pressed Ctrl+x,Ctrl+s in the Emacs editor thinking that this will exit Emacs, but it seems like nothing has happened. What is the problem?

Selecione uma das seguintes:

  • The x and s are lowercase and you must instead type X and S.

  • You have the order reversed and must instead type Ctrl+s, Ctrl+x.

  • Ctrl+x, Ctrl+s is a command sequence that saves your file, but it does not cause Emacs to close.

  • Ctrl+x, Ctrl+s is used to expand the buffer size, which is a process you don't see on the screen; and this command sequence does not exit Emacs.

Explicação

Questão 18 de 25

1

You’ve just finished entering a one-page memo in Emacs and now want to quickly go to the beginning so you can reread it. What command enables you to quickly go to the beginning?

Selecione uma das seguintes:

  • Alt+b

  • Alt+H

  • Go 1

  • Alt+<

Explicação

Questão 19 de 25

1

Which of the following are menus that you would find on the menu bar in Emacs?

Selecione uma ou mais das seguintes:

  • View

  • Options

  • Edit

  • Buffers

Explicação

Questão 20 de 25

1

Which of the following commands enables you to use online help in Emacs?

Selecione uma das seguintes:

  • Ctrl+?

  • Ctrl+h

  • ?

  • Ctrl+q

Explicação

Questão 21 de 25

1

How can you get help using the vi editor?

Selecione uma ou mais das seguintes:

  • From insert mode, press :doc.

  • From command mode, enter :help.

  • From ex mode, enter ?doc.

  • From the regular command line outside of vi, enter man vi.

Explicação

Questão 22 de 25

1

What is the name of a standardized bit pattern for characters and numbers that is used by most computer operating systems?

Selecione uma das seguintes:

  • ASCII

  • Nope.

Explicação

Questão 23 de 25

1

What is the process called compiling?

Selecione uma das seguintes:

  • Compiling is the process of translating a program file into machine language.

  • Nope.

Explicação

Questão 24 de 25

1

How can you print a file while you are in the vi editor?

Selecione uma das seguintes:

  • The shell command lpr can be used to print a file from vi. To use it, enter command mode, type !lpr and the name of the file to print.

  • Nope

Explicação

Questão 25 de 25

1

You have started Emacs without specifying a file name for the existing file you want to open. Is there a way to specify the file name and open the file after you’ve started Emacs, and if so how?

Selecione uma das seguintes:

  • Yes, the command Ctrl+x, Ctrl+f allows you to specify a filename and create that file. This an also be accomplished by selecting File > Visit New File... from the menu bar.

  • Nope.

Explicação