Quiz
Chapter 3 Review Questions
Fragen in diesem Quiz (25)
1You 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?
- Aa period (.)
- BCtrl+r
- CCtrl+R
- Da dollar sign ($)
2Which of the following enables you to move the cursor to the left while you are in command mode in the vi editor?
- APress the right arrow key.
- BPress the left arrow key.
- CPress h.
- DPress l.
3When 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?
- AEnter vi -n at the command line and then type in the file name when prompted.
- BEnter vi -n and the filename, such as vi -n myfile.
- CEnter vi and the filename, such as vi myfile.
- DEnter vi ? and then enter the file name when you see the > prompt on the command line.
4Your 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?
- AWhile in command mode, move the cursor to the last character in the line and press d-.
- BWhile in insert mode, move the cursor to any character in the line and press Alt+d.
- CWhile in command mode, move the cursor to the first character in the line and press dd.
- DWhile in insert mode, move the cursor to the last character in the line and type :#delete.
5You 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?
- AFrom command mode, press #, type update, and press Enter.
- BFrom insert mode, press Alt+ and then type update.
- CFrom insert mode, press && twice and then type update.
- DFrom command mode, type :!update and press Enter.
6While 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.
- A:r employees.txt
- B+employees.txt
- Cadd employees.txt
- D#copy employees.txt
7You’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?
- A:top
- BT
- CGo1
- DH
8You are preparing to give a training session on the vi editor. How would you BEST describe it?
- AIt is modal.
- BIt is a text editor.
- CMost UNIX/Linux distributions come with vi.
- DIt is a screen editor.
9While 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?
- AUse the Ctrl+u command.
- BUse the Alt+u command.
- CUse the Ctrl+x,u command.
- DYou're stuck retyping the deleted text, because Emacs does not enable you to undelete.
10When you copy text in Emacs, you must mark the text you want to copy by using which of the following commands?
- AUse Ctrl+Tab to mark the beginning of the text and Ctrl+Shift to mark the end. Next press Alt+z to copy the text.
- BUse Ctrl+Spacebar to mark the beginning of the text and Alt+w to mark the end as well as to copy the text.
- CUse :mark to mark the beginning of the text and :endmark to mark the end as well as to copy the text.
- DUse @begin to mark the beginning of the text and @end to mark the end. Next type :copy to copy the text.
11You’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?
- APress Ctrl+s.
- BPress Alt+f.
- CType :find.
- DType #locate.
12How can you find out information about the status of an editing session while in the vi editor?
- AType :status while in command mode.
- BPress Ctrl+? while in insert mode.
- CPress Ctrl+g while in command mode.
- DPress the Spacebar twice while in command mode.
13You 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.
- APress Alt+F2 to turn on automatic numbering for text.
- BWhen you first start vi from the command line, type vi -n.
- CEnter the number 1 plus a period at the beginning of the first line, and then each new line will be numbered automatically.
- DFrom command mode, enter :set number.
14You 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?
- AFrom command mode, enter :wq.
- BFrom command mode, enter :ZZ.
- CFrom command mode, enter :bye.
- DFrom command mode, enter :x.
15While 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'?
- AFrom command mode, type /recieve and press Enter.
- BFrom insert mode, type Alt+r and enter recieve.
- CFrom command mode, press F4 and enter recieve.
- DFrom insert mode, press F7 and enter recieve.
16As 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?
- AIt converts all letters to capitals in the file.
- BIt changes all instances of capitol to capital.
- CIt searches to ensure that each sentence starts with an uppercase letter.
- DIt finds the last instance of capital and changes it to Capitol
17You 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?
- AThe x and s are lowercase and you must instead type X and S.
- BYou have the order reversed and must instead type Ctrl+s, Ctrl+x.
- CCtrl+x, Ctrl+s is a command sequence that saves your file, but it does not cause Emacs to close.
- DCtrl+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.
18You’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?
- AAlt+b
- BAlt+H
- CGo 1
- DAlt+<
19Which of the following are menus that you would find on the menu bar in Emacs?
- AView
- BOptions
- CEdit
- DBuffers
20Which of the following commands enables you to use online help in Emacs?
- ACtrl+?
- BCtrl+h
- C?
- DCtrl+q
21How can you get help using the vi editor?
- AFrom insert mode, press :doc.
- BFrom command mode, enter :help.
- CFrom ex mode, enter ?doc.
- DFrom the regular command line outside of vi, enter man vi.
22What is the name of a standardized bit pattern for characters and numbers that is used by most computer operating systems?
- AASCII
- BNope.
23What is the process called compiling?
- ACompiling is the process of translating a program file into machine language.
- BNope.
24How can you print a file while you are in the vi editor?
- AThe 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.
- BNope
25You 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?
- AYes, 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.
- BNope.
Informationen
- Beschreibung
- Review Questions for Chapter 3: Mastering Editors
- Autor
- OpieTaylor
- Sprache
- English
- Aufrufe
- 837
- Schlagwörter
- Bewertung
- Noch keine Bewertungen Bewerte dieses Quiz