0

This question already has an answer here:

When I open a new terminal, it doesn't execute auto-start my bash_profile. I need to do "source .bash_profile".

When I use Screen, it happens again.

marked as duplicate by msw, goldilocks, slm, jasonwryan, user26112 Oct 1 '13 at 1:24

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    Scroll down to INVOCATION in man bash for information on what files are sourced when. – goldilocks Sep 30 '13 at 21:44
  • Not an exact duplicate, but close enough: new terminals and terminals spawned by screen are not login shells. See the linked answer for further details. – msw Sep 30 '13 at 21:44
  • Please give more details about how are you opening a terminal... – sebelk Sep 30 '13 at 21:49
  • 1. Right click the terminal icon on Ubuntu. – Gapry Sep 30 '13 at 21:51
  • 2. username@hostname:~$ screen – Gapry Sep 30 '13 at 21:52
2

The file ~/.bash_profile is loaded only when you invoke bash as a login shell, otherwise load the ~/.bashrc

I mean if you open a terminal in X Window likely is invoked as a non-login shell. Many X terminal emulators have an option to configure as a login shell every time you open either a window or a tab.

Not the answer you're looking for? Browse other questions tagged or ask your own question.