HPCHOST

Client Login Client Login

VI Editor Information

VI is a very verbose and useful text editor. There are litterally hundreds of commands for VI that can further streamline the process of editing text files through the command line. Some of the basic commands are as follows:

#vi filename.txt
Opens the specified filename in a vi session. If the file does not exist, a blank document is created with that filename

#i
Moves vi to INSERT mode, where text can be added or deleted.

#Esc
The escape key moves vi back to Command mode, Where most letters entered will be interpreted as commands. Text cannot be edited from Command mode.

#:
This will enter vi into Line Mode, where line oriented commands can be used. A very basic command would be #:1 , which would return you to the first line of the file.

#/
The / can be used to search a file for matching text. If multiple entries are found, 'n' will cycle to the next entry in the file.

#a
The 'a' command will append starting one space to the right of the cursor.

#q
Quit without saving changes. This command requires Line mode

#x
Write changes and quit. This command requires line mode.
More extensive documentation on the vi editor can be found online through various websites.



Was this answer helpful?

Add to Favourites
Print this Article

Also Read
Using chmod and chown (Views: 165)



Close Chat
HPC Host Live Chat