What can cause my .profile file to not be loaded when a new terminal shell is initialized?

25,681

Looks like this was answered before. You have to be aware of the loading priorities of the files.

[EDIT]

You Have two options:

  1. (Not Recommended) Get your terminal to start as a login shell:
    • open a terminal
    • Go to Edit -> Profile Preferences -> Title and Command
    • activate the "Run Command as a login shell" checkbox This way your .profile is read. But it also messes up the default loading behavior so I would recommend:
  2. Edit or create ~/.bashrc!

Look here for a good explanation about the difference between .bashrc and .bash_profile

Share:
25,681

Related videos on Youtube

Swader
Author by

Swader

Web developer, Chrome developer. More info at website.

Updated on September 18, 2022

Comments

  • Swader
    Swader over 1 year

    There are no errors in xsession and I don't have a .bash_login or .bash_profile file, so I'm 100% certain neither of those is loaded and thus cancels .profile loading.

    When I rename the .profile to .bash_profile and open a new terminal window, it still doesn't load. Everything in the file works (aliases and PATH exports) when I load it manually via ". ~/.profile", but it won't load automatically.

  • Swader
    Swader over 11 years
    Like I said, the other files do not exist. I only have one profile file, and that's .profile, and even renaming it to .bash_profile does not help. It never even tries to get loaded.
  • mrcktz
    mrcktz over 11 years
    see my edit above, hope it helps
  • nyg
    nyg about 3 years
    I think the proper way to load ~/.profile is to do so in ~/.xsessionrc. See this answer and my comment: askubuntu.com/a/1281956.