Operating Systems > Linux and UNIX

commands

<< < (2/2)

Nobber:
I'm using Debian, and /sbin is in my PATH when I log in as root. In fact, all three sbins are in there.

voidmain:
"/sbin" is in root's path in RedHat as well. I have a feeling that when you say you are logged on as root you actually did an "su". This does give you root authority but it does not load root's environment (PATH etc). If you want to switch to root and load root's environment you need to type "su -".

Now, type "echo $PATH" and tell me what's in your PATH. In order for your changes to take effect after changing your .bash_profile you need to either log off and log back on or type ". ~/.bash_profile".  That will only effect the shell you type the command in at least until you log off and log back on.

Master of Reality:

quote:Originally posted by VoidMain:
"/sbin" is in root's path in RedHat as well. I have a feeling that when you say you are logged on as root you actually did an "su". This does give you root authority but it does not load root's environment (PATH etc). If you want to switch to root and load root's environment you need to type "su -".

Now, type "echo $PATH" and tell me what's in your PATH. In order for your changes to take effect after changing your .bash_profile you need to either log off and log back on or type ". ~/.bash_profile".  That will only effect the shell you type the command in at least until you log off and log back on.
--- End quote ---


yes i did "su" and i did "su -" and it does work. Now when i do "echo $PATH" it shows /bin:/sbin:/usr/sbin:and a few other places.

Navigation

[0] Message Index

[*] Previous page

Go to full version