Add custom path and manpath in linux

Source: Internet
Author: User
When installing software in linux to a custom path, the newly installed command must be carried with a path for execution, and cannot be directly used as the built-in command. In this case, you can modify the environment variable PATH and MANPATH to use the newly installed command like a system command and view man. We... "/> <scripttype =" text/javascript "src =" http: // when installing software in linux to a custom path, the newly installed command can be executed only with a path, it cannot be used directly like the built-in commands. In this case, you can modify the environment variable PATH and MANPATH to use the newly installed command like a system command and view man. Let's take the php-fpm installation as an example. after the installation is complete, the php installation directory is the executable file/usr/local/php which is installed to the/usr/local/php/binphp man file. /php/man/man1 // usr/local/php/man/man8/1. if you use php directly on the command line without modifying the environment variables, the system will prompt-bash: php: command not found to execute export PATH =/usr/local/php/bin: $ PATH, you can directly use the php Command 2. when you use man php, the system prompts No manual entry for php to add the man path to the environment variable MANPATH. Note that you do not need to add man1 and man8 to their parent directory. Export MANPATH =/usr/local/php/man: $ MANPATH, you can find man. However, this configuration is only valid for current login users, to be permanently valid for all users, you need to modify vi/etc/profile and add export PATH =/usr/local/php/bin at the end of the file: $ PATHexport MANPATH =/usr/local/php/man: $ After MANPATH is modified, run the manpath command to view the modified path/usr/local/php/man: /usr/kerberos/man:/usr/local/share/man:/usr/share/man/en: /usr/share/man -------------------- gorgeous separation -------------------------------------------- man common knowledge man configuration file/etc/man. config: find the man content of a command you see in the man File # man-w ls/usr/share/man/man1/ls.1.gz show all # man-aw ls/ usr/share/man/man1/ls.1.gz/usr/share/man/man1p/ls.1p.gz command manpath shows the path of the current man search # manpath/usr/local/php/ man: /usr/kerberos/man:/usr/local/share/man:/usr/share/man/en: /usr/share/man an example of man mapping # manpath/usr/kerberos/man:/usr/local/share/man:/usr/share/man/en: /usr/share/man # echo "export PATH = $ PATH: /opt/mpich-1.2.7p1/bin ">/etc/profile # source/etc/profile # manpath/usr/kerberos/man:/usr/local/share/man: /usr/share/man/en:/usr/share/man:/opt/mpich-1.2.7p1/man means that if you add the PATH of a command to the PATH, the parent directory of this path contains the man directory, which is automatically added to the manpath. you do not need to manually add the manpath to/etc/profile or the current one. bash_profile
Related Article

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.