Is there a way to “resource” by bash_profile without restarting terminal? [duplicate]

耗尽温柔 提交于 2019-12-08 16:23:15

问题


I often times have to make changes to my ~/.bash_profile, and I have to restart terminal for the changes to propagate. Is there any command I can run to re-source my ~/.bash_profile?


回答1:


Yes, you can just run:

source ~/.bash_profile

Or:

. ~/.bash_profile

This will reload/re-source the .bash_profile in the current shell.

I put this command in my ~/.bash_profile for convenience:

alias reprofile='source ~/.bash_profile'

Then I just type reprofile or repro TAB.



来源:https://stackoverflow.com/questions/38297774/is-there-a-way-to-resource-by-bash-profile-without-restarting-terminal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!