The computer brain is essential to the operating system. However, Linux is developing very rapidly and is catching up with Microsoft. Here we will introduce the knowledge of Linux, so that you can learn how to use Linux. For example, to add the/etc/apache/bin directory to the PATH, there are three methods: 1. # PATH = $ PATH:/etc/apache/bin this method is only valid for the current session. that is to say, the PATH setting will expire after the system is logged out or logged out.
The computer brain is essential to the operating system. However, Linux is developing very rapidly and is catching up with Microsoft. Here we will introduce the knowledge of Linux, so that you can learn how to use Linux. For example, to add the/etc/apache/bin directory to the PATH, there are three methods:
1. # PATH = $ PATH:/etc/apache/bin
This method is only valid for the current session. that is to say, the PATH setting will expire after the system is logged out or logged out.
2. # vi/etc/profile
Add PATH = $ PATH:/etc/apache/bin in the appropriate location (note: = no space is allowed on both sides of the equal sign)
This method is best, unless you manually force modify the value of PATH, it will not be changed
3. # vi ~ /. Bash_profile
Modify the PATH and add/etc/apache/bin.
This method works for users.
Note: to change the PATH, you must log on again to make it take effect. the following methods can simplify the work:
If the/etc/profile is modified, run the source profile or the dot command./profile after editing. The PATH value takes effect immediately.
The principle of this method is to execute the/etc/profile shell script again. Note that if sh/etc/profile is used, sh is executed in the sub-shell process, even if the PATH is changed, it will not be reflected in the current environment, but the source is executed in the current shell process, so we can see the PATH change.
In this way, you will learn how to modify the PATH of the environment variable in Linux.