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 exiting the current terminal
Method Two: Modify the ~/.BASHRC or ~/.bash_profile or system level/etc/profile
1. Add For example export Path=/opt/activepython/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 exiting the current terminal
Method Two: Modify the ~/.BASHRC or ~/.bash_profile or system level/etc/profile
1. Add For example export ld_library_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. After saving, execute ldconfig effective
(The purpose of the Ldconfig command, mainly in the default search directory (/lib and/usr/lib) and the dynamic library configuration file/etc/ld.so.conf in the directory listed in the search for a shareable dynamic link library (format as described above, lib*.so*), This creates the connection and cache files required by 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.
Ld.so.conf inside the configuration, the added path is the highest priority path;
[Email protected] ~]# cat/etc/ld.so.conf
Include ld.so.conf.d/*.conf
/usr/local/fan/lib
/usr/local/fan/lib64
This article is from the "Model Student's Learning blog" blog, please be sure to keep this source http://mofansheng.blog.51cto.com/8792265/1911009
Linux environment variable setting method summary PATH, Ld_library_path