The Magic usage of PATHS.D directory under Mac

Source: Internet
Author: User
Tags imagemagick

First of all, this method is learned through the practice of PG, and this method can only be used under the Mac, there is no such method under Linux.

This PATHS.D function is very simple, is to create a file inside, and then write on the global command line to use the command, directly configure a directory.

Demonstration:

For example, I have an application. There are some useful binary packages that need to be used globally, usually the previous practice is to do the outer chain, a soft join in the past, but under the Mac can be upgraded to such a practice:

Echo /opt/imagemagick/bin| sudo Tee /etc/paths.d/imagemagick;bash-l; Echo $PATH

The final echo $PATH is for the output to take effect.

Principle:

In fact, under the/etc/profile there will be a path_helper tool, this tool will read the/ETC/PATHS.D directory in the file inside the path, and then load in the environment variable $ptah.

Eval '/usr/libexec/path_helper-s '

How to operate under Linux:

No way, just low, create a new shell file in the/etc/profile.d/directory, and then use:

Export path= $PATH:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/ jvm/java-8-oracle/jre/bin

Reference:

Https://apple.stackexchange.com/questions/128897/how-to-use-etc-paths-d-to-add-executable-files-to-my-path

The Magic usage of PATHS.D directory under Mac

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.