the difference between/etc/profile and/ETC/PROFILE.D under the Linux environment
Difference:
1. Two files are set environment variable file,/etc/profile is a permanent environment variable, is a global variable,/etc/profile.d/set all users to take effect
2./etc/profile.d/than/etc/ Profile good maintenance, do not want to what variables directly delete/etc/profile.d/under the corresponding shell script can, not like/etc/profile need to change this file
Each user in CentOS has to specify their own environment variables, which is more troublesome, so how to configure an environment variable, all users can use it?
The following is an example of JDK installation
VI /etc/profile.d/java.sh
in the new java.sh, enter the following:
#set Java Environment
java_home=/var/mysoft/jdk1.7.0_80
Path=$java_home/bin:$path
Export Java_home PATH
Save exit and assign permissions to java.sh: chmod 755/etc/profile.d/java.sh
The difference between/etc/profile and/ETC/PROFILE.D under the Linux environment