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
export LD_PRELOAD=/usr/lib/libtsocks.so

It's ok that I can export in this way, but how can I make it permanent? I want LD_PRELOAD to still be changed after a reboot. I'm using Ubuntu and Fedora

share|improve this question
up vote 10 down vote accepted

Ordinarily, you'd put your "export" line into whatever shell startup file is appropriate: .profile, .bash_profile, .zprofile, whatever, in your $HOME directory.

If you want to make it permanent for every user, the various shells usually have system-wide config files in /etc/: /etc/profile exists on this linux box, but do read the man page to figure out which user-specific and which system-wide file to put it in.

share|improve this answer
~/.profile is the right one for a per-user setting; see Alternative to .bashrc, Correctly setting environment, and the Super User questions linked in my answer there. – Gilles Jun 8 '11 at 21:13

Most distributions also have an /etc/profile.d/ directory containing a group of .sh and .csh files. Creating a new file in this directory tends to keep items better organized and keeps /etc/profile from getting cluttered.

share|improve this answer

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.