November 2005
Beginner to intermediate
528 pages
24h 11m
English
Writing a file means saving the edits and updating the file’s modification time.
|
Command |
Action |
|
ZZ |
Quit vi, writing the file only if changes were made. |
|
:x |
Same as ZZ. |
|
:wq |
Write and quit file. |
|
:w |
Write file. |
|
:w |
Save copy to |
|
:n1,n2w |
Write lines |
|
:n1,n2w >> |
Append lines |
|
:w! |
Write file (overriding protection). |
|
:w! |
Overwrite file with current buffer. |
|
:w %.new |
Write current buffer named file as file.new. |
|
:q |
Quit file. |
|
:q! |
Quit file (discarding edits). |
|
Q |
Quit vi and invoke ex. |
|
:vi |
Return to vi after Q command. |
|
% |
Current filename. |
|
# |
Alternate filename. |
Read now
Unlock full access