Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

4 Answers 4

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.