Remove path from environment variables

For the error, I added a path that I do not want to use.
I created a file called .base_profile, exported the path using the source of the .base_profile command, but I do not need this path, how to delete it?

Perhaps the title does not fit, but I did not change the PATH variable. I wrote this in a .base_profile file:

export MP=$MP/usr/local/mysql/bin 

And then used the original command. The problem is the MP variable, which is not the one I want, for too long. I want to remove it, how to do it?

+6
source share
3 answers

Do

 echo $PATH 

Then take the mouse the part that looks useful and add it to:

 PATH= 

So, for example, not in the OSX system:

 PATH=/home/ramy/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games 

If you only got the path in one terminal, you can, alternatively, open a new terminal.

If you added the original command to the same script configuration, you must delete it there to get rid of it permanently.

+4
source

The way to restore your default path is: PATH=$(getconf PATH)

+6
source

Fix your file errors and fix env var with

export PATH = [correct]

+2
source

Source: https://habr.com/ru/post/915211/


All Articles