主机文件不会在终端中显示

时间:2018-08-21 15:07:03

标签: python hosts

在尝试开发网站阻止程序时,我需要访问主机文件。我进入终端并输入

  

sudo python / private / ect / hosts>

没有任何显示。屏幕为空白。有什么建议可能出什么问题吗?This photo is a shot of the terminal with no info on it

1 个答案:

答案 0 :(得分:0)

您输错了路径,它是/private/etc/hosts。另外,使用nano时,您刚刚创建了名称错误的新目录和文件。而且/ private / etc / hosts文件不是python,因此执行sudo python不会做任何事情。