How do I find .bash_profile and add to my shell's initialization file? [closed]

北城余情 提交于 2019-12-01 04:03:28

It would be /home/$USER/.bash_profile, but would only be present if you're actually using bash as your shell. Other shells will use a 'dot file' with their name in them instead. You can view them with ls -ad $HOME/.*

There are two initialization files .bash_profile & .bashrc, both present in user home directory.

.bash_profile is initialized when you login with userid. .bashrc is initialized when you are already logged in and want to open one more terminal.

If you want to add some settings in both the file then you can do following

if [ -f ~/.bashrc ];
 then
source ~/.bashrc
fi
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!