Linux environment variable setting method summary (PATH/LD_LIBRARY_PATH)

Source: Internet
Author: User
Linux environment variable setting method summary (PATH/LD_LIBRARY_PATH) PATH: Find the executable program PATH www.2cto.com to view the current environment variable: echo $ PATH settings: Method 1: exportPATHPATH: /XXX is invalid after logout. Method 2: modify ~ /. Bashrc or...
Linux environment variable setting method summary (PATH/LD_LIBRARY_PATH) PATH: Find the executable program PATH www.2cto.com to view the current environment variable: echo $ PATH settings: Method 1: export PATH = PATH: /XXX is invalid after logout. Method 2: modify ~ /. Bashrc or ~ /. Bash_profile or system level/etc/profile 1. add such as export PATH =/opt/ActivePython-2.7/bin: $ PATH 2 in it. source. bashrc (the Source Command is also called the "Dot Command", that is, a dot symbol (.). The source command is usually used to re-execute the modified initialization file to make it take effect immediately without logging out and logging on again.) LD_LIBRARY_PATH: dynamic library search path setting: www.2cto.com Method 1: export LD_LIBRARY_PATH = LD_LIBRARY_PATH:/XXX, but it becomes invalid after being logged out. Method 2: modify ~ /. Bashrc or ~ /. Bash_profile or system level/etc/profile 1. add export PATH =/opt/ActiveP/lib: $ LD_LIBRARY_PATH 2. source. bashrc (the Source Command is also called the "Dot Command", that is, a dot symbol (.). The source command is usually used to re-execute the modified initialization file to make it take effect immediately without logging out and logging on again.) method 3: LD_LIBRARY_PATH is not modified, but the effect is the same for searching dynamic libraries. 1. /etc/ld. so. add/usr/local/mysql/lib 2 to the conf file. after ldconfig is saved (the usage of the ldconfig command is mainly used in the default search directory (/lib and/usr/lib) and dynamic library configuration file/etc/ld. so. find the shared dynamic link library under the Directory listed in conf (format as described earlier, lib *. so *) to create a dynamic loader (ld. so) the required connection and cache file. the default cached file is/etc/ld. so. cache, this file stores the list of dynamic linked library names in the sorted order .) method 3 is a little difficult to set. the advantage is that it is not restricted by users.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.