5

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

4 Answers4

7

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
max
  • 4,163
2

whereis [command]

whereis ls
ls: /usr/bin/ls

1

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

1

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.

jlliagre
  • 14,369