Linux operation: executable file, library file path settings!

Source: Internet
Author: User

I am often asked this question. How do I set the path?
Why can't I use the executable file after I leave the executable file folder?
Why is it always wrong when I use export?

There are a lot of problems. Here we will introduce a very direct and simple method. In fact, the operation is very simple. Anyone familiar with Linux should know that it is a little help to those who are not very familiar with Linux.

Operating System: opensuse 11.1 64-bit

1. Set the executable file path. We can directly modify the system file for implementation, which is very simple:
Run the following command on the terminal:

    1. Btazuo:/etc# Cd/etc
    2. Btazuo:/etc# Vim Profile

There are a lot of things in the profile file. Find the path:


In

    1. ForDirIn/Usr/X11/bin/

Add your own executable files under this line.

2. Set the library file path. The system file is still modified as follows:

    1. Btazuo :~# Cd/etc
    2. Btazuo:/etc# Vim lD. So. conf

Inside

In

    1. Include/etc/lD. So. conf. d/*. conf

Before you add your library file, that is, the path of the Lib file, it will be OK.

Restart and OK, haha.

Operating System: centos 58

The executable file path is still in/etc/profile:

1 #/etc/profile 2 3 # system wide environment and startup programs, for login setup 4 # functions and aliases go in/etc/bashrc 5 6 pathmunge () {7 if! Echo $ PATH |/bin/egrep-Q "(^ |:) $1 ($ |:)"; then 8 if ["$2" = "after"]; then 9 Path = $ path: $1 10 else 11 Path = $1: $ PATH 12 fi 13 fi 14} 15 16 # KSh workaround 17 if [-z "$ EUID"-a-x/usr/bin/ID]; then 18 EUID = 'id-U' 19 uid = 'id-Ru '20 FI 21 22 # Path manipulation 23 if ["$ EUID" = "0"]; then 24 pathmunge/sbin 25 pathmunge/usr/sbin 26 pathmunge/usr/local/sbin 27 fi

# Add the desired executable file path to then after Path manipulation, such as/usr/local/share/XXX/bin.

System library path, consistent with the above:

[Root @ localhost etc] # ll LD *-RW-r -- 1 Root 9028 Feb 23 2012 LDAP. conf-RW-r -- 1 Root 115468 Dec 9 :07 lD. so. cache-RW-r -- 1 Root 28 Oct 8 2006 lD. so. coninto. so. conf. d: total 32-r -- r -- 1 Root 324 Dec 5 kernelcap-2.6.18-308.24.1.el5.conf-r -- r -- 1 Root 324 Feb 22 2012 kernelcap-2.6.18-308.el5.conf-rw-r -- r -- 1 Root 15 Feb 14 2012 mysql-i386.conf-rw-r -- r -- 1 Root 17 May 10 2012 openais-athlon.conf-rw-r -- r -- 1 Root 20 Feb 24 2012 qt-i386.conf-rw-r -- r -- 1 Root 276 Dec 9 vmware-tools-libraries.conf-rw-r -- r -- 1 Root 21 Nov 21 xulrunner-32.conf [root @ localhost etc] # [root @ localhost etc] # cd lD. so. conf. d/[root @ localhost lD. so. conf. d] # lltotal 32-r -- r -- 1 Root 324 Dec 5 kernelcap-2.6.18-308.24.1.el5.conf-r -- r -- 1 Root 324 Feb 22 2012 kernelcap-2.6.18-308.el5.conf-rw-r -- r -- 1 Root 15 Feb 14 2012 mysql-i386.conf-rw-r -- r -- 1 Root 17 May 10 2012 openais-athlon.conf-rw-r -- r -- 1 Root 20 Feb 24 2012 qt-i386.conf-rw-r -- r -- 1 Root 276 Dec 9 vmware-tools-libraries.conf-rw-r -- r -- 1 Root root 21 Nov 21 xulrunner-32.conf [root @ localhost lD. so. conf. d] # Cat mysql-i386.conf/usr/lib/MySQL

To add a library file path, you only need to add a CONF file in LD. So. conf. D: to specify the path, such as the mysql-i386.conf above, it specifies the path. This is because:

There is only one sentence in the file lD. So. conf:

 
1 include lD. So. conf. d/*. Con

All rights reserved. For more information, see!

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.