Network – Edit Hosts file on ESX
Here are the simple commands to edit a hosts file on an ESX server…
Log on as root
Enter vi /etc/hosts
Press ESC, then i to insert
Edit Text
Press ESX, the :wq press enter to save
Here are some common commands with vi
“you have to enter command mode first using ESC “
i = insert at this charachter
x = delete a charachter
dd = delete a line
yy = copy
p = paste a copied line
a = append to the next charachter
A = append to the end of aline
I = insert at the beginning of a line
:w = write
:q = quit
:w! = force a write (read only files)
:q! = force a quit no changes