$PATH: determines which directories the shell will look for commands or programs, and the PATH value is a series of directories that Linux searches for and compiles links to when you run a program.
Edit the PATH declaration in the format:
Path= $PATH:<path1>:<path2>:<path3>:--:<pathn>
You can add the specified path yourself, separated by a colon in the middle. When the environment variable is changed, it will take effect the next time the user logs on, and if you want to take effect immediately, execute the following statement:
$source. Bash_profile
Use the Export command to view the path value.
To view the PATH environment variables individually, use:
Echo $PATH
Add path environment variable, available:
Export path= Path: $PATH
View command: Echo $PATH to determine if PATH success was added.
The path of the above method disappears after the terminal is closed. Therefore, it is recommended to change the path by editing/etc/profile, or to change the. BASHRC (ie: ~/.BASHRC) in the home directory.
The second method:
# Vim/etc/profile
At the end of the document, add:
Export path= "directory: $PATH"
Save, exit, and then run:
#source/etc/profile
No error is successful.
Add PATH environment variable, available:
[Root@localhost U-boot-sh4] #export path=/opt/stm/stlinux-2.3/devkit/sh4/bin: $PATH
View again:
[Root@localhost u-boot-sh4]# Echo $PATH
/opt/stm/stlinux-2.3/devkit/sh4/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin :/bin:/usr/sbin:/usr/bin:/root/bin
Description Add path succeeded.
The path of the above method disappears after the terminal is closed. Therefore, it is recommended to change the path by editing/etc/profile, or to change the. BASHRC (ie: ~/.BASHRC) in the home directory.
instance: adding ~/.composer/vendor/bin to path when using Laravel
$vi. BASHRC
At the end of the file join
Export path= "~/.composer/vendor/bin: $PATH"
$source. BASHRC