4 ms·
The only problem with this method is that if you modify your hosts file, you have to modify both.
by ianl 15y ago
The only problem with this method is that if you modify your hosts file, you have to modify both.
- StavrosK 15y agosudo cp /etc/hosts /etc/hosts.bak && cat hosts.work >> /etc/hosts sudo cp /etc/hosts.bak /etc/hosts Note: I just wrote this now with no testing whatsoever.
- pyre 15y agoJust create a Makefile or something that cats together hosts.common and hosts.work or hosts.play. all: cat hosts.common hosts.work.in > hosts.work cat hosts.common hosts.play.in > hosts.play Make common changes to hosts.common and easily build your final hosts files. play: cat hosts.play | sudo tee /etc/hosts > /dev/null work: cat hosts.work | sudo tee /etc/hosts > /dev/null
- macrael 15y agoHow often do you modify your hosts file? I only ever find myself adding more things to block to it.