0

I ran these 2 commands simply in the terminal:

export PATH="$PATH:/home/milkncookiez/Developer/android-studio/bin"
export PATH="$PATH:/home/milkncookiez/Developer/PhpStorm/bin"

in the 2 bin folders I have the files studio.sh and phpstorm.sh. In that same terminal session when I simply wrote the name of the files - the programs were ran.

When I opened another terminal - did not work. I added these both lines in the ~/.profile file, opened a new terminal session but it still does not work. How do I set the 2 variable changes to be permanent for all terminal sessions?

2 Answers2

2

Adding them to ~/.profile (apply to your user) or a /etc/profile.d/*.sh file (apply to the entire system) is the correct way. In order for the change to apply, you have to log out of your system and log back in, as ~/.profile and /etc/profile.d/*.sh are loaded when you login.

To 'reload' ~/.profile in a running terminal, you can use source ~/.profile

Tobias
  • 1,678
1

You don't need to use export; the PATH variable is already exported at that point. Anyway, .profile is read when you log in, so what you've done is correct, but opening a new terminal does not count as logging in.

geirha
  • 47,279