15 QUESTIONS ABOUT vi BASED ON READING 179 - 233 (vi-quick notes might help):

  1. How do you switch between command mode and insert mode?

  2. In command mode,
        what does Ctrl-u do? Ctrl-d?
        what is the difference between w and W, and between b and B?
        what does $ do? How about zero (0)?
        what does o do? Which mode does it end up in?

  3. In insert mode,
        what does each of the following do:

  4. How do you exit vi without altering the file you have open?

  5. How do you delete the current line?

  6. Suppose you delete a line; can you somehow reverse that operation?

  7. Suppose you wrote your first name, but forgot to capitalize the first letter. How can you capitalize one character? What is the name of that funny character and where is it located on your keyboard?

  8. What is the quickest way to navigate to the last line of a file? How about to the top of a file?

  9. How do you search for the word "fuzzy" in a file?

  10. Suppose the word "fuzzy" were on lines 3 and 9 of the file, and your cursor is one line 8. When you search for fuzzy, will go to line 3 or line 9?

  11. Suppose you wanted to play if very safe and NEVER alter any file that you view with vi. What alias could you us to the vi command to make it so that vi never modifies the files you view?

  12. Suppose you work for General Motors and have to add your name, Quarkson, to the list of employees in the Technical Publications Department. How can you start vi at that portion of the huge Employees file that deals with Technical Publications. (Hint: what "regular expression" can give as an "argument" when you open vi? What two characters precede the "string" of your argument?)

  13. What command lets to substitute one character for another at the place where the cursor is?

  14. The readme.txt file for Product Whizbang that you are working on has the word Whizbang many times. Marketing just decided to change the product name to SuperWhizbang. Using vi, how can you quickly replace all the occurences of "Whizbang" with "SuperWhizbang" (and thereby become a hero)?

  15. What command would you "feed" vi to change "Whizbang" with "SuperWhizbang" only for the first 250 lines of the readme.txt file?

Happy Hacking. Please email your work and any questions to
Thank you and see you Thursday.


copyleft copyleft.gif (70 bytes) 1999 Thomas Albert