Tuesday, October 6, 2015

Block unwanted advertisements with /etc/hosts file on Linux

Now we will make the shell script.

vi /root/update_hosts.sh

Fill the file with the following:
cd /tmp
wget http://winhelp2002.mvps.org/hosts.txt
rm /etc/hosts
mv hosts.txt /etc/hosts
cat ~/.etchosts >> /etc/hosts

Now we have to make sure the script is executable: 
chmod +x update_hosts.sh
For Windows check this : http://winhelp2002.mvps.org/

No comments:

Post a Comment