As a web developer, I have to edit /etc/hosts daily. Even though I use Vi to update the file and I usually can get it done quickly enough(usually 20 seconds) but 20 seconds for just adding a /etc/host is way too long for me. So I wrote a little shell script to speed up the process a little bit.

Installation

Copy the script to your machine

curl -L http://bit.ly/1FD5aWv > addhost
or 
wget -O addhost http://bit.ly/1FD5aWv

Make the script to be executable and move to bin folder so you can use it globally

chmod +x addhost && mv addhost /usr/local/bin/addhost

How to use it?

Enjoy!