What is vi?
vi editor is elaborated as visual editor. It is installed in every Unix system. In other words, it is available in all Linux distros. vi editor is the most popular and commonly used Unix text editor
Saving and Closing the file:
Commands | Action |
---|---|
:wq | Save and quit |
:w | Save |
:q | Quit |
:w fname | Save as fname |
ZZ | Save and quit |
:q! | Quit discarding changes made |
:w! | Save (and write to non-writable file) |
Moving within a file
Commands | Action |
---|---|
j | To move down |
k | To move up |
h | To move left |
l | To move right |
To jump lines:
Commands | Action |
---|---|
G | Will direct you at the last line of the file |
Leave a comment