2

I'm quite a newbie, but I know every time you start Terminal, some files are taken into account; and among those there is ~/.profile, which contains the following lines:

if [ -d "$HOME/bin" ] ; then
  PATH="$HOME/bin:$PATH"
fi

I created the directory ~/bin because I want to put there some personal stuff. I closed Terminal and re-opened it, but PATH doesn't include ~/bin. So, as an experiment, I added a stupid

echo "hello world!"

at the bottom of ~/.profile, saved changes and re-logged in with terminal, but nothing. It seems that file is totally ignored.

Am I wrong? Or something changed?

user665110
  • 123
  • 4
  • 7
    Does this answer your question? [Why isn't .profile sourced when opening a terminal?](https://askubuntu.com/questions/566399/why-isnt-profile-sourced-when-opening-a-terminal) – Christoph Grimmer Jun 25 '20 at 10:07
  • What might help you while fiddling around is typing `. ~/.profile` in a terminal. Mind the space after the first '.'! This will manually evaluate (AKA source) the file so inside that terminal the changes are effective. – Christoph Grimmer Jun 25 '20 at 10:11

1 Answers1

2

~/.profile may be read for login shells, but not by manually opening gnome-terminal.

If you are on a desktop, ~/.profile is sourced by the display manager at login. So if you relogin, your ~/bin folder will be prepended to PATH.

Gunnar Hjalmarsson
  • 32,938
  • 3
  • 63
  • 94
  • I think I should learn what is a login shell first. Anyway: I logged out and logged in again and it works. Thanks a lot. – user665110 Jun 25 '20 at 10:38