当我试图从命令行重新加载.bash_配置文件时,我遇到了一些问题

当我试图从命令行重新加载.bash_配置文件时,我遇到了一些问题,bash,shell,.bash-profile,Bash,Shell,.bash Profile,如何从命令行重新加载.bash\u配置文件?当我通过键入su-username或source~/.bash_profile在终端上尝试此命令时,我得到以下结果: 当我尝试使用su-username时: MacBook-Pro-de-Khayati-iteb:~ Khayati_iteb$ su - khayati_iteb Password: -bash: /Users/macbookpro/.profile: No such file or directory MacBook-Pro-de-

如何从命令行重新加载.bash\u配置文件?当我通过键入
su-username
source~/.bash_profile
在终端上尝试此命令时,我得到以下结果:

当我尝试使用
su-username
时:

MacBook-Pro-de-Khayati-iteb:~ Khayati_iteb$ su - khayati_iteb
Password:
-bash: /Users/macbookpro/.profile: No such file or directory
MacBook-Pro-de-Khayati-iteb:~ Khayati_iteb$ source ~/.bash_profile
-bash: /Users/macbookpro/.profile: No such file or directory
MacBook-Pro-de-Khayati-iteb:~ Khayati_iteb$ 
当我尝试使用
source~/.bash\u配置文件时

MacBook-Pro-de-Khayati-iteb:~ Khayati_iteb$ su - khayati_iteb
Password:
-bash: /Users/macbookpro/.profile: No such file or directory
MacBook-Pro-de-Khayati-iteb:~ Khayati_iteb$ source ~/.bash_profile
-bash: /Users/macbookpro/.profile: No such file or directory
MacBook-Pro-de-Khayati-iteb:~ Khayati_iteb$ 

使用命令
nano~/.bash\u profile
访问
.bash\u profile
后,第一行是:
source~/.profile
因此我将其更改为
source~/.bash\u profile

问题解决了。非常感谢各位
chepner
SiKing

你们的
配置文件中似乎有一行类似于
source/Users/macbookpro/.profile
,这条路径不存在。发布你的
.bash\u档案
怎么样?为什么它应该自己源代码?对不起,我不理解你的问题?你说你在做
源代码~/.bash\u档案
内部
~/.bash\u档案
。不,我的意思是在~/.bash\u档案中,我把第一行从~/.profile改为'源~/.bash_配置文件'