PATH in unix

Hi,
I want to know the default precedence of PATH variable (esp in HP Unix).
is /usr/local/bin having higher precedence or /usr/bin?
which tar is better to use /usr/local/bin/tar or /usr/bin/tar?

Run

set

command on your prompt to see contents in PATH variable.The shell searches the PATH in order.
/bin:/usr/local:/usr/ucb:/usr/bin
/bin has higher precedence..and so on.

thanks for reply, but i want to know what is defect precedence between /usr/local/bin and /usr/bin as per unix standard. because i have 2 different env with different precedence and tar is different in both these bins.

There is no standard default precedence. Every Unix based OS have their own PATH preferences. Typically /bin will have higher precedence than the /usr/bin which in turn will have a higher precedence that /usr/local/bin. In order to find out what is the value of the PATH variable in your case you can type the following command at your shell prompt.

echo $PATH

The directory which appears first in the list will have the higher precedence.

Here is some story on using command from diferent path ---
I am not agree on precedence of path ,It is all how your OS is (64 bit/32 bit) and how your file system size.

Example --
I have ls , and rm command in /bin directory also in /usr/bin directory

If you will try to remove a file or list a file which is more then 2GB with simple using the ls or rm command you wont be able to do that if your path sequence is /bin:/usr/bin

Your command will fail.

But when the sequence will /usr/bin:/bin
the command will work ?

Reason : --- Command from /usr/bin directory are large file aware and can access size more then 2^31 -1
While command of /bin directory can access a file size of max 2^31-1 size that is around 2GB not more then that.

It all depend your requirement and put the file in PATH for precedence .

Hope you got some idea