Under Windows, most applications and application data are stored in a special directory known as C:\Program Files
(and occasionally C:\Program Files (x86)
). What is the Ubuntu/Linux equivalent to this path? Is there even one?
Under Windows, most applications and application data are stored in a special directory known as C:\Program Files
(and occasionally C:\Program Files (x86)
). What is the Ubuntu/Linux equivalent to this path? Is there even one?
Late Answer - I've created a roadmap for beginners to follow. If they are looking for a file but don't know where to look, they can use the map to roughly navigate around. You can download a hi-res PNG here. You can find the related post here.
[EDIT: You should probably check out d4nyll's answer instead, which is a nifty map, acting as an extensive beginner's guide to the Linux file system]
/bin
and/usr/bin
is where the scripts are that start the programs. The direct equivalent of "Program Files" though is probably/opt
or maybe/usr/share
(see Filesystem Hierarchy Standard). That directory contains the various support files for most programs.There probably isn't a direct equivalent however, since, for example, library files are shared across the system (in
/lib
) and options are either user specified (in the user's home directory) or universally located in/etc
.So installing a program via a deb file, repository or build will likely place files in all of these locations.
[EDIT] And as others note, there is also
/sbin
and/usr/sbin
. Plus/usr/local/bin
,/opt/bin
and even/usr/games/
. So definitely not a direct comparison toc:\program files
!EDIT: See also d4nyll's answer
belowabove for an excellent and beginner-friendly map!Read my answer below for more info on what the
PATH
environment variable is, what.desktop
files are, and how to find a specific program using various linux commands.Original answer:
There is no easy answer.
/bin
,/usr/bin
, and/usr/share
As mentioned in the other answers, you can find most executables under
/bin
or/usr/bin
, and the support files are installed in/usr/share
./usr/local
and/opt
There are however more directories in which Ubuntu installs applications. The
PATH
variable, which determines where to search for an entered command, might give you a clue, mine looks like (echo $PATH
in a terminal):As you can see some software is installed in
/usr/local
and have their own directory andbin
. Another place where many programs are installed is/opt
. The properties of these locations are explained by the Filesystem Hierarchy Standard, which is a very good read. Unfortunately, the difference between/opt
and/usr/local
is not very well explained, someone on the unix stackexchange had a more elaborate explanation:/usr/local
is a place to install files built by the administrator, usually by using the make command. The idea is to avoid clashes with files that are part of the operating systems that would either be overwritten or overwrite the local ones otherwise. eg./usr/bin/foo
is part of the OS while/usr/local/bin/foo
is a local alternative,/opt
is a directory to install unbundled packages each in their own subdirectory. They are already built whole packages provided by an independent third party software distributor. For examplesomeapp
would be installed in/opt/someapp
, one of its command would be in/opt/someapp/bin/foo
[and then usually a symbolic link is made in one of thebin
directories in thePATH
, or the program is called from a desktop file (see below)].Finding a specific program or command
.desktop
filesTo find out where a specific program is installed, you can do a number of steps. First you need to locate its
.desktop
file. Desktop files are simular to shortcuts in Windows, and for system applications they are located in/usr/share/applications
. The desktop files for applications that are only available for the current user are in~/.local/share/applications
. Take for example Google Chrome, which has the desktop file/usr/share/applications/google-chrome.desktop
and look for the line that starts withExec=
, this determines how to start Google Chrome. It says:So you know Google Chrome is in
/opt
.Now for Mozilla Firefox which is located in
/usr/share/applications/firefox.desktop
. It simply saysAt first this doesn't seem to help that much, but then you realize that
firefox
must be in a directory that is in thePATH
variable (most likely abin
), and we can look it up (see below).Looking up commands
To look up commands you can use one or more of the following:
type
,which
andwhereis
(I've included a link to their manual pages online).type: it describes a command, and indicates how it would be interpreted if used as a command name. Possible types for a command are:
(type itself is a shell builtin, try it with
type type
:P)Executing
type firefox
gives uswhich is what we wanted to know
If a command is a file (which you checked with
type
) you can then also use:which: shows the full path of the command,
Executing
which firefox
gives uswhereis: locate the binary, source, and manual page files for a command.
Executing
whereis firefox
gives usBonus
You can inspect
/usr/bin/firefox
closer withls -l /usr/bin/firefox
and this gives:It appears that
/usr/bin/firefox
is 'only' a symbolic link to the script/usr/lib/firefox/firefox.sh
. If you inspect the script you discover that the script calls/usr/lib/firefox/firefox
.You may rest in peace now :)
There is no single directory that is the exact equivalent of Program Files folder. The way Linux arranges things is a lot different than Windows.
In windows, every program that we install gets its own directory inside the Program Files directory. In that directory, further sub-directories are created for different kind of files. There is no fixed structure for sub-directories. Programs decide for themselves what they want to call each directory and where they want to put what.
But in Linux when a program is installed, different kind of files are copied to different locations. Executables are copied to /usr/bin, library files to /usr/lib, documentation to one or more of /usr/man, /usr/info and /usr/doc. If there are configuration files, they are usually in the user's home directory or in /etc.
The
C:\Program Files
folder would be/usr/bin
in Ubuntu./bin
looks more likeC:\windows
.From the manual page of the filesystem hierarchy:
Ubuntu has a different structure than windows. Ubuntu places almost all applications in one directory, say
/usr/bin
. Windows would make a new folder, sayMozilla Firefox
, and add configuration, executables, DLL's, images, etc. in it. Ubuntu splits them up, executables go in/usr/bin
, system-wide configuration in/etc
, shared objects in/usr/lib
, images in/usr/share
, ...Linux 'Program Files' are in the whole hierarchy. It could be on
/usr/bin
,/bin
,/opt/...
, or in another directories.I think you are going to find some file related to your application. Then, I have an idea on how to looks files which are installed on program installation.
synaptic
by issuingsudo apt-get install synaptic
on terminal.Properties
.Installed File
tab. The result is same asdpkg -L package_name
.It is because linux move the installed file to directories separately based on their type.
/usr/bin
or/bin
./usr/share/icons
or on~/.local/share/icons
for local./opt
./usr/share/applications
or on~/.local/share/applications
/usr/share/doc
/usr/lib
And many other directories. (CMIIW, accepting correction)
The way that Linux and Windows programs are installed is quite different.
The common pattern in Windows is for a program; or a bunch of programs, from one vendor go into its own sub directory in C:\programs\vendor or something similar.
In Linux, your files are split up between specific sub directories depending on their function. There are directories for libraries, icons, man pages, Log files, configuration and so on. You may use some of them, but the system will manage all of them. They are not coupled together, but exist together with similar files from other programs.
So there is no real equivalent to that Windows directory structure in a regular Linux implementation.
In this answer when I say Unix I mean Unix as well as Unix-like operating systems.
Ubuntu doesn't really have a programs folder containing all of the data for each program. In Unix and Unix-like operating systems, EVERYTHING is a file, even the terminal commands. They're files as well. The way Unix handles programs can be pretty chaotic, and organized at the same time.
Icons for programs are stored in /usr/share/icons/*, program executables are usually stored in /usr/bin, /bin, and other places with bin directories (bin is obv short for binary). Libraries that programs depend on are in /lib.
So you end up with not a directory containing all of the data for one program, but the data for the program spread out. While at first this seems very disorganized, it allows for sharing of standard things like libraries and icons.
Thanks to permissions for each file, the idea of everything being a file is very brilliant to be honest. It makes Unix MUCH more secure than other operating systems.
If you install own programmes, I recommend 1 folder:
Look in
/bin
,/usr/bin
, and anything else that saysbin
.