.bash_PROFILE:Mac终端中没有这样的文件或目录

时间:2017-12-20 15:35:24

标签: macos shell terminal

当我打开终端时,我收到以下错误,无法输入新命令。关闭并重新启动我的Mac并没有解决问题。我该如何解决这个问题?

-bash: /Users/HabibAlejalil/.bash-PROFILE: No such file or directory
-bash: /Users/HabibAlejalil/.bash-PROFILE: No such file or directory
-bash: /Users/HabibAlejalil/.bash-PROFILE: No such file or directory
-bash: /Users/HabibAlejalil/.bash-PROFILE: No such file or directory
-bash: /Users/HabibAlejalil/.bash-PROFILE: No such file or directory
-bash: /Users/HabibAlejalil/.bash-PROFILE: No such file or directory
-bash: /Users/HabibAlejalil/.bash-PROFILE: No such file or directory
-bash: /Users/HabibAlejalil/.bash-PROFILE: No such file or directory
-bash: /Users/HabibAlejalil/.bash-PROFILE: No such file or directory
-bash: /Users/HabibAlejalil/.bash-PROFILE: No such file or directory
-bash: /Users/HabibAlejalil/.bash-PROFILE: No such file or directory
-bash: /Users/HabibAlejalil/.bash-PROFILE: No such file or directory
-bash: /Users/HabibAlejalil/.bash-PROFILE: No such file or directory
-bash: /Users/HabibAlejalil/.bash-PROFILE: No such file or directory
-bash: /Users/HabibAlejalil/.bash-PROFILE: No such file or directory
-bash: /Users/HabibAlejalil/.bash-PROFILE: No such file or directory
-bash: /Users/HabibAlejalil/.bash-PROFILE: No such file or directory

[Process completed]

1 个答案:

答案 0 :(得分:0)

您需要找出哪个文件尝试访问.bash-PROFILE。当然你可以使用常见的嫌疑人(.profile,.bashrc,.bash_profile等),但这并不能保证它会出现。如果它没有,你应该产生一些正在执行的内容:

我首先尝试按

打开一个bash子shell
bash -li

并查看错误消息是否再次显示。如果确实如此(可能,但不是肯定),请使用

重复此测试
bash -lix

会告诉你罪魁祸首。如果bash -li 显示错误,我会在set -x/etc/profile的开头添加~/.bashrc并打开新终端。