vi is a standard but powerful screen-oriented text editor. You’ll be needing it if you are not using a GUI desktop in your Red Hat Enterprise Linux or CentOS server. This is a quick tutorial on how to use vi to enable you to use it immediately.
1. Type in vi filename
and press Enter
. If filename exists, vi will open it. If the filename does not exists, vi will create a it.
2. vi is now in view/command mode. Type in i
to shift to edit/insert mode.
3. You can now begin typing the text or making changes to the file.
4. When you’re done making your changes, press Esc
to go back to view/command mode.
5. Type in :wq
to save your changes and quit or :q!
to cancel your changes and quit.
Visit the forum to ask for help or to give a comment.
Posted on 3/15/2008 and last updated on 3/6/2011
Filed under System Administration