Mac终端错误:-bash:/Users/tim/.profile:没有这样的文件或目录

tim*_*vin 18 terminal

每次打开一个新的终端窗口时,我都会看到以下内容.

-bash: /Users/tim/.profile: No such file or directory
Run Code Online (Sandbox Code Playgroud)

我不知道为什么会发生这种情况或在哪里寻找解决方案; 我的个人资料/Users/tim/.bash_profile不在/Users/tim/.profile

有关如何排除故障的任何想法?

noc*_*abt 39

这也发生在我身上,我发现在它的顶部.bash_profile有:

source ~/.profile
Run Code Online (Sandbox Code Playgroud)

我的理解是,在MacOS/OS X .bash_profile上优先考虑,.profile因此不需要后一个文件.

因此,我只需source ~/.profile从文件顶部删除即可.

希望有所帮助.

编辑:原创海报评论说他刚刚创建了一个空白.profile来解决这个问题.

  • `touch~/.profile`为我解决了这个问题. (8认同)
  • 在我的情况下,我刚刚创建了一个空的`〜/ .profile`文件,消息消失了.因为你是唯一一个回答的人,所以会给你信誉.:) (7认同)

小智 9

我今天遇到了同样的问题,我猜是因为我使用了清洁应用程序并且该应用程序认为这个文件浪费空间所以删除了它。touch ~/.profile帮我。