Goals for this Hour

In this hour, you learn

  • How to search within a file

  • How to search and replace

  • How to have vi start out right

  • The key colon commands in vi

  • The change and replace commands

  • How to use the :! command to access UNIX commands

This may seem like a small list, but there's a lot packed into it. I'll be totally honest: You can do fine in vi without ever reading this hour. You already know how to insert and delete text, and save or quit without saving, and you can search for particular patterns, too—even from the command line as you start vi for the first time! On the other hand, vi is like any other complex topic: The more you're willing to study and learn, the more the program will bow to your needs. This means you can accomplish a wider ...

Get Sams Teach Yourself UNIX® in 24 Hours Second 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.