Both path and Ld_library_path are variables, and the so-called variables mean that they are assigned by others, and intuition tends to allow us to add and reduce certain paths to the variable itself, which is actually not true. The right thing to do is to modify the configuration file that gives the value of the variable, add a path, or subtract a single line. In the final analysis, variables are only about display, not about what they are intended to display.
Path: The lookup path to the executable program
To view the current environment variables:
Echo $PATH
Set up:
Method One: Export path=path:/xxx but fails after logout
Method Two: Modify the ~/.BASHRC or ~/.bash_profile or system level/etc/profile
1. Add For example export Path=/opt/activepython-2.7/bin: $PATH
2. Source. BASHRC (The source command is also known as a "point command", which is a dot symbol (.).) The source command is typically used to re-execute a newly modified initialization file for immediate effect without having to log off and log back in.
Ld_library_path: Find path for dynamic libraries
Set up:
Method One: Export ld_library_path=ld_library_path:/xxx but fails after logout
Method Two: Modify the ~/.BASHRC or ~/.bash_profile or system level/etc/profile
1. Add For example export path=/opt/activep/lib: $LD _library_path
2. Source. BASHRC (The source command is also known as a "point command", which is a dot symbol (.).) The source command is typically used to re-execute a newly modified initialization file for immediate effect without having to log off and log back in.
Method Three: This is not modified Ld_library_path but the effect is the same as the implementation of dynamic library search,
1. Add a line below/etc/ld.so.conf/usr/local/mysql/lib
2. Save after Ldconfig (the purpose of the Ldconfig command, mainly in the default search directory (/lib and/usr/lib) and dynamic Library configuration file/etc/ld.so.conf listed in the directory, the search for a shareable dynamic link library (format as described above, lib*.so*) to create the connection and cache files required for the dynamic loader (ld.so). The cache file defaults to/etc/ld.so.cache, which holds the list of queued dynamic-link library names.)
Method Three is slightly cumbersome, and the benefit is that the comparison is not restricted by the user.
Linux environment variable setting method summary (Path/ld_library_path)