Network – Edit Hosts file on ESX

Posted on

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

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.