&path: Determines to which directories the shell will look for commands or programs, the PATH value is a series of directories, when you want to run a program, Linux in these directories to search and compile links.
Edit the path declaration in the following format:
Path= $PATH: <path1>:<path2>:<path3>:------:<pathn>
You can add the specified path yourself, separated by a colon. When the environment variable is changed, it takes effect the next time the user logs on, and if you want to take effect immediately, you can execute the following statement: $source. bash_profile
Export command: View the value of path
Use: [&&&@******/]$ Export
View PATH environment variables separately, available: echo $PATH
The first type: Temporarily add environment variables :
Add Command: Export path= path: $PATH
View command: Echo $PATH to determine if the PATH was added successfully.
The path to the method described above disappears after the terminal is closed. So it is recommended to edit the /etc/profile to change the path, you can also change the home directory of the. BASHRC (i.e.: ~/.BASHRC).
The second way: it's permanent.# Vim/etc/profile at the end of the document, add:export path= "directory: $PATH" ( Note: There can be no spaces between PATH and equal sign, equal sign, and later )Save, exit, and then run:#Source/etc/profile no error is successful.
View and add environment variables under Linux