I'm trying to add an environment path /usr/pgsql-9.5/bin for all users on my CentOS 7 system.I created a new file under /etc/profile.d/It looks like this:export PATH=/usr/pgsql-95/bin:$PATHI then restart the system and login using root.I type in echo $PATH, it lists/usr/pgsql-9.5/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/binSo everything is correct for root user.I then type sudo su postgres echo $PATHIt lists:/sbin:/bin:/usr/sbin:/usr/bin/usr/pgsql-9.5/bin is missing?Why is the path not added for user postgres? If I create a new user the path is correctly added $PATH.
environment path for all users
linux;centos;path
You are using su not su -lUsing su -l will provide environment like direct login and it will set environment variable mentioned by you in /etc/profile.d/filenameTry sudo su -l username