Chapter 11. Advanced vi Tricks, Tools, and Techniques

In the preceding hour, you learned what probably seems like a ton of vi commands that enable you to easily move about in files, insert text, delete other text, search for specific patterns, and move from file to file without leaving the program. This hour expands your expertise by showing you some more powerful vi commands. Before you begin this hour, I strongly recommend that you use vi to work with a few files to ensure that you're comfortable with the different modes of the program.

Goals for This Hour

In this hour, you will learn

  • How to search within a file

  • How to search and replace

  • How to have vi start correctly

  • The key colon commands in vi

  • The change and replace commands

  • How to use the :! command ...

Get SAMS Teach Yourself Unix in 24 Hours FOURTH EDITION now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.