.profile file not running when logging into terminal

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Post Reply
dabrox02
Level 1
Level 1
Posts: 2
Joined: Mon Mar 25, 2024 5:12 pm

.profile file not running when logging into terminal

Post by dabrox02 »

I recently installed jEnv, a Java version management tool, I followed the installation steps which are super simple, however, when I close and open my terminal, the configuration disappears and it does not recognize the new commands.

Installation guide: https://www.jenv.be/

Analyzing the problem, I discovered that Linux Mint, instead of .bash_profile, handles .profile, so I modified the installation commands for .profile, however, it was not solved either.

I also noticed, when I run exec $SHELL -l, if it detects the configuration

Distribution:
OS: Linux Mint 21.3 x86_64
Kernel: 5.15.0-101-generic
User avatar
karlchen
Level 23
Level 23
Posts: 18239
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: .profile file not running when logging into terminal

Post by karlchen »

Hello, dabrox02.

bash sources the content of .profile or .bash_profile only, in case it functions as the login shell.
By default, however, when you launch a terminal window, bash is the shell, but not the login shell. (No login happens, when you launch a terminal window.)

The configuration file, which will always be read by bash is .bashrc.
As a consequence, you may want to put your commands into the file .bashrc

Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 792 days now.
Lifeline
dabrox02
Level 1
Level 1
Posts: 2
Joined: Mon Mar 25, 2024 5:12 pm

Re: .profile file not running when logging into terminal

Post by dabrox02 »

Thank you very much for your contribution, I added the commands at the beginning of the .bashrc just as you said and it worked
Post Reply

Return to “Beginner Questions”