Arrange the dirty environment variable PATH

Check current PATH

** Format the PATH and make a note of it as it will be used when resetting. ** **

$ echo $PATH
 /home/yourname/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:

Clear PATH

unset PATH

Pass through the new PATH

$ export PATH=$PATH:/usr/local/bin/:/usr/bin/

Persistence

If you just execute it in a terminal, it will be valid only in the terminal where you executed it, so describe it in ~ / .bashrc etc.

~/.bashrc


export PATH=$PATH:/usr/local/bin/:/usr/bin/

update


source ~/.bashrc

Recommended Posts

Arrange the dirty environment variable PATH
Linux PATH environment variable
Set the environment variable PYTHONPATH on zsh
[C language] [Linux] Get the value of environment variable
Let's add it to the environment variable from the command ~
[Anaconda] Activate the virtual environment
Maya | Get the workspace path