The nano editor is usually the editor of choice for beginners. It is a great editor, but let's just say that it's not the most efficient editor out there. The vi editor is a more advanced Linux editor with tons of features and is by far the most popular editor among advanced Linux users.
Let's open the facts.txt file with the vi editor; to do that, you run the vi facts.txt command:
elliot@ubuntu-linux:~$ vi facts.txt
This will open the vi editor, as shown in the following screenshot:
Unlike the nano editor, the vi editor works in two different modes:
- insert mode
- command mode
The insert mode enables you to insert text into a file. On the other hand, the command mode allows you to do things like copying, pasting, and deleting text. The command mode also allows you to search and replace text along with many other things.
Insert mode
By default, you enter command mode when you first open the vi editor, and you can...