Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Where are executables for programs stored in Ubuntu?

An application (Komodo Edit) is asking me to identify an application to be used as a web browser. I've become used to just entering the application name as a command for situations such as these, but this scenario got me thinking.

I know in Windows it would just be the relevant application folder in the 'program files' folder, but I'm assuming things are a bit different on Linux?

I thought somewhere like bin would be logical but this appears to standard Linux/Unix applications. Where would I find the binary executable for applications stored on my system?

share|improve this question

4 Answers 4

up vote 23 down vote accepted

The complete answer is to check out the Filesystem Hierachy Standard documentation on what stuff goes where.

But in your case, if you want to know where a particular executable is (for example firefox) use

which firefox

And you will get the full path like this

/usr/bin/firefox
share|improve this answer
1  
Filesystem Hierachy Standard... interesting... I won't be going through it with a fine-tooth comb, but its definitely good to know about it... It has given me another notch of insight into Linux... –  Peter.O Oct 21 '10 at 12:17

Applications installed through the package manager usually go to /usr/bin. Applications you compile yourself go to /usr/local/bin/ unless you explicitly set a different prefix when compiling.

You can find out where a specific application lives by typing which application_name into the terminal. E.g. which firefox will print /usr/bin/firefox (if you're using firefox from the Ubuntu packages).

share|improve this answer

A good CLI commad for this kind of questions is:

whereis <nameofwhatever>

or, of course which (see below)

share|improve this answer
3  
This will find files named <nameofwhatever> which may or may not be executables. Some may even be directories. You should use which in place of whereis. –  Richard Holloway Oct 21 '10 at 11:47
    
Full ACK for standard installations (that we all hopefully have). –  Takkat Oct 21 '10 at 12:32

You can also try this if you're looking for the executable from a package name:

dpkg -L firefox

This will list all files owned by firefox. To get the executables, pass it through further processing

dpkg -L firefox | while IFS=$'\n' read -r line; do
    [[ -x "${line#*:}" ]] && echo "$line"
done
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.