问题描述
我打听到我的.bash_profile试图Playframework添加到我的路径,并得到了一些严重混乱。
I added something to my bash_profile while trying to add Playframework to my path and something got messed up badly.
我添加下面一行到我的.bash_profile
I added the following line to my .bash_profile
export PATH=$PATH:the path to my play excitable
然后我救了一切,重新开始我的终端。我不能再从我的终端做任何事情。我不能cd到任何目录,我再也找不到java的,我不能打开VI或纳米。
我发现this线程上的超级用户,暗示打开一个不同的终端和改变bash的配置文件。
then I saved everything and restarted my terminal. I can no longer do anything from my terminal. I can't cd into any directory, I can no longer find java, I can't open vi or nano.I found this thread on SuperUser that suggested opening a different terminal and changing the bash profile.
我试图通过键入打开庆典
I tried opening bash by typing
/bin/bash
和我能够成功打开另一个终端,但我仍然没有访问任何正规的UNIX命令。我仍然无法打开VI或纳米来移除导致问题的行。
and I was successfully able to open another terminal but I still don't have access to any of the regular unix commands. I still wasn't able to open vi or nano to remove the line that is causing the problem.
我试着下载没有任何运气。
I tried downloading a new terminal application without any luck.
我试图打开隐藏文件,这样我就可以改变文件与运行以下命令文本编辑器:
I tried turning on hidden files so that I can just change the file with a text editor by running the following command:
defaults write com.apple.finder AppleShowAllFiles TRUE
但由于我的终端不能正常工作了也不能工作。
but since my terminal isn't working that didn't work either.
我怎样才能解决我的电脑。
How can I fix my computer.
推荐答案
虽然这是offtopic的计算器,它也pretty简单修复:
While this is offtopic for stackoverflow, it's also pretty simple to fix:
- 开始Terminal.app。
-
重置
$ PATH
:
$ export PATH=/bin:/usr/bin:/usr/local/bin
修复〜/ .bash_profile中
:
$ vi ~/.bash_profile
或者你也可以避免设置 $ PATH
在所有:
Or you can avoid setting $PATH
at all with:
$ /usr/bin/vi ~/.bash_profile
这篇关于如何恢复的.bash_profile在Mac上?我的UNIX终端没有正在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!