O'Reilly logo

Mac OS X Tiger in a Nutshell by Jason McIntosh, Chuck Toporek, Chris Stone, Andy Lester

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Interacting with the Shell

Command

Action

:r file

Read in contents of file after cursor.

:r !command

Read in output from command after current line.

:nr !command

Like preceding, but place after line n (0 for top of file).

:!command

Run command, then return.

!object command

Send object, indicated by a movement command, as input to shell command command; replace object with command's output.

:n1,n2! command

Send lines n1 through n2 to command; replace with output.

n!!command

Send n lines to command; replace with output.

!!

Repeat last system command.

!!command

Replace current line with output of command.

:sh

Create subshell; return to file with EOF.

Ctrl-Z

Suspend editor; resume with fg.

:so file

Read and execute ex commands from file.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required