Exiting from the Editor

Your first few last-line mode commands are very simple. (They can get much more complex.) You probably want to save your edits and exit from the editor. The last-line mode command sequence to do this is :wq. This is actually two last-line mode commands. It is the w, which means write the changes to the file, and the q, which means quit from the editor.

Maybe you are hung over one morning, and you start making a bunch of changes to a file, which, upon review (before exiting the editor, and as you sober up) you find to be totally incorrect. It might behoove you at that time to quit from the editor without saving your changes. This can be achieved by the last-line mode sequence of :q!. The : is issued from command mode and ...

Get Korn Shell Programming by Example 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.