Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The $PATH I have when I run terminal in an nX session is different to that I have when I run terminal after logging on physically.

The former is


while the latter is


The latter has /home/agrimm/bin/ while the former doesn't (and yes, I've rebooted since creating /home/agrimm/bin)

I suspect the difference is that .profile is getting run in the latter, but not in the former. has in the last paragraph:

Non-login shells have login shells (or something that behaves like a login shell) as their parent, and inherit most of their environment variables, including PATH, from this login shell. So putting path-modifying commands in ~/.profile requires that you log out and back in for them to be effective, but it affects the environment of non-login shells too (as well as the environment for programs that are not shells, since every program gets its own set of environment variables--called its "environment"--inherited from its parent process).

I assume that logging in with nX is "something that behaves like a login shell", and that when I run terminal, the parent process of terminal ought to provide it with a complete $PATH, including home/agrimm/bin.

Is my assumption correct? If so, how do I get nX to run .profile?

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.