linux怎樣修改hosts文件

方法:1、利用“vi /etc/hosts”命令打開hosts的編輯文本模式;2、輸入命令“i”進入編輯模式,使用“sudo vi /etc/hosts”命令強制改變文件權限;3、輸入密碼修改文件內容;4、利用“wq”命令保存修改結果即可。

linux怎樣修改hosts文件

本教程操作環境:linux7.3系統、Dell G3電腦。

linux怎樣修改hosts文件

修改hosts文件,需要修改文件 /etc/hosts 然后重啟tomcat

修改文件/etc/hosts

第一步:

輸入命令:vi /etc/hosts

打開hosts的編輯文本模式

第二步:

輸入命令i

進入編輯模式,此時可能會提示:changing a ”readonly” file attention

此時可以使用強制改變文件權限命令:sudo vi /etc/hosts

輸入對應的密碼,回車,進入編輯模式修改內容完成

第三步:

輸入命令::wq 保存并退出

第四步:

輸入命令: cat /etc/hosts 查看修改的hosts文件內容是否修改成功

相關推薦:《Linux視頻教程

以上就是

? 版權聲明
THE END
喜歡就支持一下吧
點贊7 分享