如果是不是私人电脑,那么需要联系你的部门,有可能是网络管理员禁止了
如果是私人电脑,检查bash的启动profile文件:.bash_profile, .bash_login, .profile或者.bashrc。
排除问题步骤:
生成一个新管理员用户,然后登陆到新管理员用户中,尝试启动终端程序
如果没有问题:在把原来用户目录下面的文件.bash_profile, .bash_login, .profile或者.bashrc,只要是存在的就改名、删除或者移动
也可以使用下面的命令移动它们。假设:原用户名="john",那么运行下面命令,它会要求输入当前管理员帐户的密码;依据自己的情况更改命令中下划线的部分:uPath="/Users/john":
uPath="/Users/john";sudo mkdir "$uPath/bashProfile"; sudo mv "$uPath/.bash_profile" "$uPath/.bash_login" "$uPath/.profile" "$uPath/.bashrc" "$uPath/bashProfile"
如果依然有问题:启动到恢复界面,在终端程序中改名、删除或者移动
比如启动卷:Macintosh HD;原用户名是:john;运行下面的命令,它会要求输入当前管理员帐户的密码。
你依据自己的情况更改命令中下划线的部分:uPath="/Volumes/Macintosh HD/Users/john":
uPath="/Volumes/Macintosh HD/Users/john";mkdir "$uPath/bashProfile"; mv "$uPath/.bash_profile" "$uPath/.bash_login" "$uPath/.profile" "$uPath/.bashrc" "$uPath/bashProfile"
解释:
上面的两个命令基本相同,只是目录路径有变化。
它所做的是:在原用户目录下面生成一个bashProfile子目录,然后将前面列出的所有的profile文件都移动到里面
以后如果有需要,可以从这个子目录中恢复。