VI is an extremely popular full-screen document editor in the Unix world, and almost any UNIX machine will provide this software as a Notepad for Windows .
Type vi/etc/hosts
Enter the VI interface and move the cursor to the end of the file. Press ESC to make the command mode, then enter a, and a new line to enter the host you want to configure, such as: 192.168.0.192 photo.dxxf.net.
Press ESC when finished to command mode, enter: WQ (note need to enter:) Save exit.
2, modified with the nano command:
The Nano is a small, free, and friendly editor that has nano commands on most Linux. Relative VI, unfamiliar with Linux I feel nano to be a lot simpler:
After opening , edit directly, the command is as follows:
sudo Nano/etc/hosts
Press Ctrl+x to exit when finished, press Y to save, enter
The difference between the VI and Nano commands in Ubuntu text editing (Nano is recommended)