Guide to UNIX Using Linux Fourth Edition
Chapter 3 Solutions
Answers to the Chapter 3 Review Questions
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?
(Choose all that apply.)
2. Which of the following enables you to move the cursor to the left while you are in command mode in
the vi editor? (Choose all that apply.)
3. 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?
4. 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?
dd.
5. You are in the vi editor and it’s now noon. Everyday at noon you run a program called update, which
updates a database. How can you run the program without closing your vi session?
6. While you are working on a report in vi, you decide to insert information from another text file in your
home directory called summary_data. Which of the following commands (from command mode)
enables you to add the contents of summary_data?
7. 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?
8. You are preparing to give a training session on the vi editor. How would you describe it? (Choose all
that apply.)
9. 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?
10. When you copy text in Emacs, you must mark the text you want to copy by using which of the
following commands?
11. 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 slightly. What command can you
use to track down all references to the old name so you can locate them?