Differences between the vi and nano commands during Ubuntu text editing (nano is recommended)
Vi is a very common full-screen file editor in the Unix world. It can be said that almost any Unix machine will provide this software, just like Windows notepad.
Type vi/etc/hosts
Go to the vi interface and move the cursor to the end of the file. Press ESC to run the command mode, enter A, and enter the host you want to configure in A new line, for example, 192.168.0.192 photo.dxxf.net.
Press ESC to run the command. Enter wq (Note:) to save and exit.
2. Run the nano command to modify:
Nano is a compact, free, and friendly editor that has nano commands in most linux systems. I think nano is much simpler than vi but I am not familiar with linux:
Edit the file directly after it is opened. The command is as follows:
Sudo nano/etc/hosts
Press ctrl + x to exit, Press y to save, and press ENTER