0

etc/profile:

if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then
        PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${ROOTPATH}"
else
        PATH="/usr/local/bin:/usr/bin:/bin:${PATH}"
fi
export PATH
unset ROOTPATH

echo $PATH:

/sbin:/bin:/usr/sbin:/usr/bin

So:

/usr/local/bin is not showing up, so I think it may be using a different file.

I have tried putting export PATH=$PATH:/usr/local/bin and it's fine but that is not permanent.

tread
  • 10,133
  • 17
  • 95
  • 170
  • Shouldn't this question be moved to "Unix & Linux"? – wei2912 Dec 06 '13 at 09:47
  • please don't comment unless you have some value to contribute: [link] http://stackoverflow.com/questions/13631173/adding-a-path-to-the-bashrc-file, [link]http://stackoverflow.com/questions/14175773/echo-path-doesnt-match-bash-profile – tread Dec 06 '13 at 12:36

1 Answers1

1

Check your shell init files, for bash that would be /etc/bashrc or /etc/bash.bashrc or something like that as well as ~/.bashrc and ~/.bash_profile. Most shells have similiar init scripts, check the manual.

Also check out /etc/env.d/* and /etc/environment.

ckruse
  • 9,642
  • 1
  • 25
  • 25
  • I've checked `bashrc`...there's nothing specified regarding `$PATH`...also I have read that it is better practise to use profile instead of bashrc...I've checked the environment globals and I see the path `/opt/bin` alot. – tread Dec 06 '13 at 07:50
  • Did you also check the init files in `/etc`? – ckruse Dec 06 '13 at 07:55
  • No. There are environment files, too: `/etc/environment` and all files in `/etc/env.d/`. For example, my `PATH` variable is set by `/etc/env.d/00basic` and modified by `~/.zshrc`. – ckruse Dec 06 '13 at 08:15
  • Yes. Already responded...in `00basic` it says `PATH="/opt/bin"` as alluded to above. Nothing in `environment`. – tread Dec 06 '13 at 08:28