Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

the default .profile does not export PATH, still the PATH set there is available to all processes.

How does that work?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

If there is already an exported shell variable, then subsequent resetting of the variable will automatically export it. So in this case, if you run "env" prior to where .profile sets PATH, you will probably see it was previously set / exported (either in /etc/profile, /etc/bash_profile, or somewhere else).

share|improve this answer
it looks like login initially sets PATH manpages.ubuntu.com/manpages/precise/en/man1/login.1.html making it implicitly exported, then pam_env.so (loaded by login, I think) resets it based on /etc/environment –  Alex Sep 9 '12 at 3:00

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.