How to set path for a command

Hi all,

I am trying ping command in SUN v240 server but it is not working

but when i am using the full path

/usr/sbin/ping <ip address> then it is working.

how to set the path of ping command so that by simply typing

ping <ip address>

it should work ?

Plz help me out:(

add /usr/sbin to your PATH variable, the correct location and method for this depends on what shell you are using and will be described in the appropriate man page.

oracle user is not able to run ping command without full path

i have to set the path in his ./profile file???

ex: ping=/usr/sbin/ping

correct me if i m wrong?

you ARE wrong - reread reborg's post.
You need to set up the shell environment variable PATH appropriately.

IF you do that then the previous set path is going to lost instead of assign better you insert the new location in path variable

PATH=$PATH:/usr/sbin/

I'm not sure what you re referring to, nobody suggested setting the PATH to be /usr/sbin.

Please set the path in $HOME/.profile file and add entry at end of file

PATH=$PATH:/usr/sbin/ping
export PATH

If you want to run this command from every user profile then same entry put in /etc/profile

For affecting please logout and log in again

Thanks
Pravin :b:

PATH=$PATH:/usr/sbin/ping
By doing this isn't good enough.. You probably wont want to enter every single command in here .. :confused: