gpt4 book ai didi

linux - 编辑/etc/hosts 文件 OS X

转载 作者:太空宇宙 更新时间:2023-11-04 05:50:47 25 4
gpt4 key购买 nike

我有一个奇怪的问题,它变得相当烦人,因为我无法解释为什么我对/etc/hosts 文件的编辑没有保存。当我使用 sudo 权限进行编辑并保存它们时,它看起来很好。一旦我打开新终端或退出终端并再次检查我所做的编辑就消失了。

sudo vim /etc/hosts/ or sudo vim /private/etc/hosts


##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost

我尝试添加这一行:127.0.0.1 ac-decountsv.example.com我还尝试编辑/private/etc/hosts/.有人可以告诉我我忽略了什么吗?

谢谢

最佳答案

OS X 对系统文件的更改有锁定;删除锁定并进行更改。

这可能有帮助: https://superuser.com/questions/40749/command-to-unlock-locked-files-on-os-x

关于linux - 编辑/etc/hosts 文件 OS X,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38899475/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com