see PATH:echo $PATH
To add python3 Column
Modify method 1 :
export PATH=$PATH:$HOME/bin:
export PATH=$PATH:$HOME/bin:/usr/local/python3/bin
// After configuration, you can use echo $PATH View configuration results .
Effective method : Immediate effect
Term of validity : A temporary change , Only valid in the current terminal window , When the current window is closed, it will be restored path To configure
Scope of authority : Only for current users
Modify method 2 :
By modifying the .bashrc file :
vim ~/.bashrc
// Add... To the last line :
export PATH=$PATH:$HOME/bin:
export PATH=$PATH:$HOME/bin:/usr/local/python3/bin
Effective method :( There are two )
1、 Close the current terminal window , Reopening a new terminal window will take effect
2、 Input “source ~/.bashrc” command , Immediate effect
Term of validity : Permanent validity
Scope of authority : Only for current users
Modify method 3 :
By modifying the profile file :
vim /etc/profile
/export PATH // Find settings PATH The line of , add to
export PATH=$PATH:$HOME/bin:
export PATH=$PATH:$HOME/bin:/usr/local/python3/bin
must : System restart
Term of validity : Permanent validity
Scope of authority : For all users
Modify method 4 :
By modifying the environment file :
vim /etc/environment
stay PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:" Add “/usr/local/python3/bin”
must : System restart
Scope of authority : Permanent validity