Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

I have this in /etc/profile in Fedora 17:

EDITOR="/usr/bin/emacs -nw"


The $PATH variable concatenation is in effect when I login as root or as postgres but not when I login to my account. I'm using terminator.

As root:

# echo $PATH

As postgres:

$ echo $PATH

In my account:

$ echo $PATH

Notice the absence of the /usr/pgsql-9.2/bin path.

/home/cpn/.bash_profile has this line:

export PATH

When I su - (notice the -) to my account the path is there so I guess it is a matter of login vs not login shell.

How to make the terminal to always open a login shell?

share|improve this question
Most, but not all, login methods read /etc/profile. How do you log in? If you use a graphical display manager (a program where you type your password in graphics mode), which one (e.g. gdm, kdm, lightdm, …)? – Gilles Oct 8 '12 at 23:46
@Gilles I'm using Terminator. Edited the question to add it. – Clodoaldo Oct 9 '12 at 0:03
Terminator is a terminal emulator in which you can run a shell. How do you log in (i.e. where do you type your username and password)? – Gilles Oct 9 '12 at 0:06
@Gilles I login to Cinnamon. I guess it uses gdm. – Clodoaldo Oct 9 '12 at 0:52
@Clodoaldo If you need to have the path set, why not try to simply include . /etc/profile as the first line of your .bash_profile? – Karlson Oct 9 '12 at 13:33

If you want the directory in your PATH for all sessions, you could add it to /etc/environment. Be careful if you do that though - if you screw up the PATH in /etc/environment there's a chance that your system will not boot anymore.

share|improve this answer

Don't know if this is the correct fix. I did check Run command as a login shell in terminator -> profiles -> Command.

share|improve this answer
No, that's not a good idea. See Alternative to .bashrc – Gilles Oct 8 '12 at 23:45
As Gilles noted, there's a difference between login and non-login shells, so that non-login ones do not load /etc/profile by default, as described here: linuxfromscratch.org/blfs/view/svn/postlfs/profile.html. So it seems to depend on gdm (if it's still gdm), whether it sources "/etc/profile" or not. Try reading /etc/gdm/Xsession, it might not contains the source strings, as in bugs.launchpad.net/ubuntu/+source/lightdm/+bug/794315 – Bob Oct 9 '12 at 10:21

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.