I'm using Ubuntu 16.04 and I cannot unset the http_proxy permanently. Every time I open a terminal window, it is restored to

I have checked /etc/environment, ~/.profile, ~/.bashrc and the scripts inside /etc/profile.d but find nothing about proxy.

So now I want to know how to find out where-in which file-an environment variable is defined. I mean something like where http_proxy and it prints /etc/blahblah(the path of the file that defines http_proxy).


1 Answer 1


Just add to .bashrc a line with export http_proxy="<proxy you want to use>". This way each time you will run a new shell, this proxy will be in use, same for https and ftp proxy

  • But I want to find out in which file http_proxy is defined, not how to define it.
    – zwcloud
    Apr 9, 2017 at 7:05
  • In Centos this should be in /etc/bashrc, find similar file in /etc or in /usr. But as far as I know by default this variable is not set in linux, additionally you can check does new user has this variable set to the same value.
    – darvark
    Apr 9, 2017 at 7:09
  • I'm using Ubuntu. But thanks for the information.
    – zwcloud
    Apr 9, 2017 at 7:11

Not the answer you're looking for? Browse other questions tagged .