获取mac系统的电脑名称
修改并配置 /etc/hosts 文件
sudo vi /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
127.0.0.1 org.cat
255.255.255.255 broadcasthost
::1 localhost
修改之后的内容大致如下:
##
# 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
127.0.0.1 org.cat
255.255.255.255 broadcasthost
::1 localhost userName-MacBook-Pro.local
修改的内容很简单,只需要在最后一行,添加hostname的映射即可
修改了hosts文件之后,原来需要十几秒启动,现在2s就可以启动了。