9to6linux.com
Covering latest Linux News, Tutorials, Reviews and more

How to Use the VI Editor in Linux

To work on the VI text editor, you have to know how to use the VI editor in Linux. Let’s find it out from this article. - Community submission by Editor (9to6linux) on

How to Use the VI Editor in Linux

How to Use the VI Editor in Linux

To work on the VI text editor, you have to know how to use the VI editor in Linux. Let’s find it out from this article.

VI text editor works in two modes, 1) Command mode and 2) Insert mode. In the command mode, users’ commands are taken to take action on a file. The VI editor, usually, starts in the command mode. Here, the words typed act as commands. So, you should be in the command mode while passing a command.

On the other hand, in the Insert mode, file editing is done. Here, the text is inserted into the file. So, you need to be in the insert mode to enter text. Just type ‘i’ to be in the insert mode. Use the Esc key to switch from insert mode to command mode in the editor. If you don’t know your current mode, press the Esc key twice. This takes you to the command mode.