Mac OS hosts 文件的锁定保护及修改

锁死hosts文件

sudo chflags uchg /etc/hosts
sudo chflags schg /etc/hosts

解锁hosts文件

sudo chflags nouchg /etc/hosts
sudo chflags noschg /etc/hosts