home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Learning the vi Editor

Learning the vi EditorSearch this book
Previous: A.2 Editing Commands Appendix A
Quick Reference
Next: A.4 Command Line Options
 

A.3 Exit Commands

ZZ Write (save) and quit file
:x Write (save) and quit file
:wq Write (save) and quit file
:w Write (save) file
:w! Write (save) file (overriding protection)
: 30,60w newfile Write from line 30 through line 60 as newfile
:30,60w>> file

Write from line 30 through line 60 and append to file

:w %. new Write current buffer named file as file.new
:q Quit file
:q! Quit file (overriding protection)
Q Quit vi and invoke ex
:e file2 Edit file2 without leaving vi
:n Edit next file
:e! Return to version of current file at time of last write (save)
:e# Edit alternate file
% Current filename
# Alternate filename


Previous: A.2 Editing Commands Learning the vi Editor Next: A.4 Command Line Options
A.2 Editing Commands Book Index A.4 Command Line Options

The UNIX CD Bookshelf Navigation The UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System