I have Ubuntu 10.04. I want to define some environment variables that will be available anywhere, anytime, including from Eclipse. Where is the best place to put them? ~/.bashrc? ~/.profile? /etc/environment?

Why are there so many places to define settings?

  • What desktop environment are you using? What window manager? – Keith Aug 28 '11 at 11:39
  • I use gnome desktop. How can I know what window manager I use? – Erel Segal-Halevi Sep 4 '11 at 6:32
  • @Erel: If you're using a full DE such as GNOME or KDE, the window manager is not important. (GNOME uses either Metacity, Compiz, or Mutter.) It only makes a difference when the WM is being used standalone. – user1686 Dec 15 '11 at 14:04

~/.profile might be the best place – it is read for graphical logins (GDM), console logins, and even SSH. (The latter two only if neither ~/.bash_profile nor ~/.bash_login exists, though... but GDM always reads it.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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