Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

How to get the location of a program in Ubuntu? For example I have Oracle, how to get the folder racine (location) of Oracle?

share|improve this question
up vote 3 down vote accepted

You can also use whereis. It will show the path to the binary but also some related files like documentation:

whereis program

share|improve this answer

You can use which to determine which binary is being run.

  • which ssh
  • which Oracle

These are examples and would return the full path for the binaries.

You could also use whereis to locate additional information, but it may confuse you in this situation.

share|improve this answer

Bash and Dash have the command built-in command that can show you the location of a command with the -v switch, if the command refers to an executable. For built-in commands and aliases the result is different. Examples:

$ command -v java
$ echo $?
$ command -v echo
$ command -v ls
alias ls='ls -h --color=auto'
$ command -v non-existing_command; echo $?

Additionally, all shells derived from Sh, know the type command that tells you about the nature of any command.

$ type java
java is /usr/bin/java
$ type ls
ls is aliased to `ls -h --color=auto'
$ type echo
echo is a shell builtin
$ type non-existing_command
bash: type: non-existing_command: not found

type -a lists everything that a command may refer to:

$ type -a ls
ls is aliased to `ls -h --color=auto'
ls is /bin/ls
$ type -a echo
echo is a shell builtin
echo is /bin/echo
$ type -a touch
touch is /usr/bin/touch
touch is /bin/touch
share|improve this answer

Your Answer


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.