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