Lab Three - Basic vi Commands

In the first lab on the vi editor, students learned some survival vi - how to get in and how to get out. The purpose of this assignment is to learn some every day commands, such as cutting-and-pasting and searching.

Your textbook, A Practical Guide to Ubuntu Linux, has a limited section on vi on pages 172-179. So, I suggest you find a good reference page for vi. Here is one that I found that is handy.

Using the information is your textbook and information you find online, complete the following:



Your Name:  _____________________

Specify the vi command to perform the following operations:

1. Other than using the arrow keys, move the cursor up one line.


2. Move the cursor to line number 3.


3. Other than using the arrow keys, move the cursor right one character.


4. Copy the current line into the buffer.


5. Paste the buffer below the current line.


6. Duplicate the next 10 lines. (this requires 2 commands)


7. Find the next instance of the string "for".


8. Delete the current line.


9. Undo the previous delete.


10. Save without exiting.


11. Exit without saving.