Stanford University School of Earth Science
 
Home
News
New Users
Policies
Network File Server
Web Server
Get Help
Net Connections
Your Macintosh
Your Windows PC
Your Unix/Linux System
Other School Resources
Using Unix
   Overview
   Documentation
   Accounts
   Using the Shell
   Using X-Windows
   File Manipulation
   Net Commands
   Editing Text
   Formatting Text
   Printing
   Filters & Utilities
   Programming

Escaping to a shell command

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
 

You can run another command, such as ls, without leaving the editor. Just type

:! command_and_its_arguments <CR>

The single command (or pipeline) will be run, with output displayed on the screen as appropriate. You will then be requested to press the <CR> key again to re-draw the vi screen.

An alternative form allows you to run another command, capture its output, and insert that output into your file on new lines starting after the line the cursor is on. This usage is described in the section on moving text from one file to another.

 


Comments?

Stanford University    |