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.


Copy the script to your machine

curl -L > addhost
wget -O addhost

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?