Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Could someone please let me know how to get to know the executable path of a command/utility in solaris?? like executable path of ls is /usr/bin

share|improve this question

use type command

For example

[max@localhost ~]$ type cal
cal is /usr/bin/cal
[max@localhost ~]$ type ifconfig
ifconfig is /sbin/ifconfig
[max@localhost ~]$ type ping
ping is /bin/ping
share|improve this answer
type -P will give you the pure path in a more easily machine-consumable format. – kojiro Sep 25 '12 at 12:43

whereis [command]

whereis ls
ls: /usr/bin/ls

share|improve this answer

You could use which command to see the full name of an executable. Like 'which foo' would return the full path to foo

share|improve this answer
this is yielding me onlt the utitlites present in /usr/bin. I would want to find the path of otherutilities present in other folders as well.. – Akanksha Sep 25 '12 at 7:22

That depends on the shell you use and whether the command is in your PATH or not.

Assuming you are using ksh, you can use the whence command in the first case. If the command is not in your path or if you want to know if alternative versions exist, you can run something like

find $(find / ! -local -prune -o -name "*bin" | grep bin) -type f -name ls 

It assumes commands are in all in directories which name ends with bin, which is usually the case.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .