Text editing in Unix



Last revision August 2, 2004

Table of Contents:
  1. Editor choices on Unix
  2. Characteristics, advantages, and disadvantages of vi
  3. Basic text editing operations in vi
  4. Regular expressions
  5. File searching with grep
  6. More about regular expressions
  7. Intermediate text editing with vi
  8. Vi Quick Reference

The editing function as described here is simply the input and manipulation of bytes or characters in a file. On Macintosh and PC systems, this function is often combined with the formatting function of laying out text on a page, into a single program called a word processor, e.g., Microsoft Word, etc. In Unix, editing and formatting functions are strictly separate.

WARNING: if you want to use a Mac/PC word processing program to edit a file and then transfer it to a Unix system for further processing, be sure to save it with the TEXT-ONLY W/ LINE BREAKS format on the Mac/PC. Otherwise, the special formatting control characters inserted by the word processing program will make the file difficult to use with Unix utilities or programs.

Macintosh and PC systems are often more friendly when making minor changes to formatted documents - you can see the formatting changes as you update the file contents.

However, the Unix method of separating editing from formatting allows much more powerful editors, especially for writing computer programs or manipulating data files.

Comments or Questions?