0

Every time I'm getting this:

env | grep -i proxy
HTTP_PROXY=http://:
https_proxy=http://:
http_proxy=http://:
HTTPS_PROXY=http://:

And I want to remove this proxy...

Tell me how to edit this command through vim editor: env | grep -i proxy

I have already used:

sudo vi env | grep -i proxy

but it shows:

Vim: Warning: Output is not to a terminal
0
1

The command env | grep -i proxy is just that: a command. All this command does is produce some output. In this case, the output tells you which environment variables are set where either the name or the value of the variable contain the string proxy, case-insensitively.

vim is a text editor. It is used to edit (text) files. You're trying to use a text editor to edit terminal output, which doesn't make sense in the first place, and even if you edited the terminal output, it wouldn't change the fact that these variables are still set. If you want to permanently unset some environment variables, editing terminal output is not the way to go.

What you want to do is find out how and where these environment variables are being set. Presumably, you have a few lines in you ~/.bashrc (assuming you are using bash) or ~/.profile files that set these variables at the start of a session. You can use vim to edit these files like so:

vim ~/.bashrc
vim ~/.profile

Search for lines that look like

export HTTP_PROXY=http://

and remove them.

Please be aware that vim is a rather advanced editor that is not necessarily intuitive to use. If you have not used vim before, I would suggest you use another editor for such a simple task, such as nano, which comes preinstalled with Ubuntu:

nano ~/.bashrc
nano ~/.profile
2
  • There is no any line like export HTTP_PROXY=http:// that I'll find in ~/.bashrc and ~/.profile. Is there any other location where I can find these lines and edit it. – Digbijay Panda Sep 8 '18 at 16:33
  • Have a look here for a few good suggestions on how to pinpoint the location where some given environment variable is being set: How to determine where an environment variable came from – Malte Skoruppa Sep 8 '18 at 17:06

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.