O'Reilly logo

Practical UNIX by Steve Moritsugu - DTR Business Systems

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

Harnessing Other UNIX Commands to Work in vi

Earlier, you saw how to apply sed to some or all of the lines of the file. You can use that same technique to use other UNIX commands to manipulate lines in vi.

Checking Other UNIX Commands While in vi

While you are editing in vi, you might want to look up some information by running other UNIX commands or pipelines. You can do this from vi Command mode, by entering this:

:! cmd

Replace cmd in the preceding command with the desired UNIX command or pipeline you want to run. The output from that command will appear on your screen. At the end, it will prompt you to press the Enter key. Then you will be back in vi Command mode, ready to do more editing of your file. You saw this process in the preceding ...

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