sh 修复hosts文件损坏

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 修复hosts文件损坏相关的知识,希望对你有一定的参考价值。

#!/bin/sh

# Solution found here (run with sudo): 
#   http://superuser.com/questions/866086/localhost-aliases-in-mac-os-x-mysteriously-stopped-working

tr '\015' '\012' < /etc/hosts > /tmp/hosts.$$
mv /etc/hosts /etc/hosts.bad
mv /tmp/hosts.$$ /etc/hosts
chown root:wheel /etc/hosts
chmod 644 /etc/hosts

以上是关于sh 修复hosts文件损坏的主要内容,如果未能解决你的问题,请参考以下文章

sh 修复损坏的qemu磁盘映像

xlsx文件损坏如何修复(xls文件损坏怎么修复)

怎样修复损坏了的innodb 表

PDF文件损坏?有效修复方式,亲测

C盘系统文件提示损坏怎么办?系统文件损坏怎么修复

C盘系统文件提示损坏怎么办?系统文件损坏怎么修复