Linux Mint Forums

Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.Before you post please read how to get help

Okay... having installed and uninstalled a few apps now, I am noticing some unexpected behavior; and that is there seems to be none (or very little) reason behind where the apps get installed to.

Examples of what I am referring to is this... I installed a few games, and they get installed in different folders with no logic behind it:

/usr/games/Game1/usr/share/games/Game2/usr/local/games/Game3

And it's the same with work-related apps; I never have a clue if they are in:

/usr/bin/usr/share/bin/usr/local/bin

So I ask, is there a logic behind the locations that I am missing? Or just don't understand? I like to keep things tidy and organized... and the seemingly random location of apps is hampering my neatness.

Thanks, that test was actually quite fascinating... I do have several copies of some programs (different versions) and now I know which one gets executed.

@Oscar799

That link was helpful, but I am still kind of wondering:

It says /bin is for "User Binaries" and /usr is for "User Programs"... now maybe I'm just out of the tech loop here but what exactly is the difference between the two?And /usr/local/ makes no sense to me... isn't every program installed on my machine a "local" program, or am I not understanding the context of the word in this case?That page also states that /usr/bin is for "Second-level programs" but what does that mean? If it's programs installed afterwards, then what is the use for /opt ?

Sorry, but this is the Newbie area for my newbie questions after all. --Jim

Guess I'm not the only one who isn't sure about these things. I can't seem to find any definitive answer on Google, beyond the link that Oscar799 posted. They all seem to copy and paste the same bit of info and that's it.

There isn't an absolute standard, because various Linux distributors have historically used some locations that were included into the FHS (File Hierarchy Standard) for compatibility's sake!https://en.wikipedia.org/wiki/Filesyste ... y_Standard--see the references section for various Linux distribution differences..

RedHat (Fedora) and Debian or Debian derivations Ubuntu:Mint..

The reason it is slow to change, if it would ever be done is this compliance need to match/keep older customers of a particular Linux distributor's versions.--and for their sake, and until end-of-life attribution to a Linux release, it is unlikely to be that much changed

Nevertheless, it is via that standards approach FHS, mostly compliant..

Using some of the tools available right there in Linux can help a person get used to the directory structure and kinda make some sense of it. Seeing the location of application files, you start getting a feeling for where certain types of files are gonna be located. This is kinda going at things from the reverse direction, but it was helpful to me for understanding the Linux file system.

I'm writing from Fedora 16, where I've installed the Geany text editor. Some commands that give me some info:

Often, I'll go to the package manager to get a list of installed files for a particular application. For Debian-based distros, I like to use Synaptic for this, but the following also works from the command line (again for Geany):

If you do this type of thing often enough, things become a bit clearer, and these tools are also helpful for when different distros differ in where they put things, because you can take a look at the output of some of these commands and then know right away where to find what, for any particular app.

For files that come pre-installed on your Linux distribution, here are the file locations. The Linux binary system programs are stored in the /bin folder (directory). The /boot folder contains the Linux kernel and the boot loader. The folder /etc contals the system-wide configuration files. These are configuration files for the linux system itself. Shared libraries are stored in /lib. Libraries correspond roughly with Windows .dll files. The /opt folder holds "optional" applications, generally commercial software products and the like. This is where applications like Firefox, Teamviewer, Adobe Air and proprietary printer applications typically go. The /usr folder contains a /bin, a /share and other folders for the programs that you install yourself. Some commercial programs like Skype go in here as well, but almost all of the Free and Open Source applications you find in your Linux distribution's software repositories will go here. Very predictable.

Thanks everyone, I know I'm a bit dense but this is really helping me understand the Linux way of arranging files.Let me make sure I understand this: (please correct any mistakes I may have)

/bin is for system commands like ls, top, grep, that are common among all Linux systems

/usr/bin is for user commands that are distro specific... I notice that all the Mint commands are in here

/usr/local/bin is for programs specific to my system. I notice the few programs I compiled from source are the only things in this folder... and "apt" for some reason is also in here.

/opt I really have no idea... I have my lcd-console-display driver in here, as well as firefox, and my printer driver. Seems to be a mix of stuff.

From what I can tell not many packages seem to obey these standards... For example, in /usr/bin, I also have commands in here too such as "less" and "zip" and "link". Shouldn't these be in /bin since they are not really distro specific? Or have I still missed it?

Thanks for your help guys, just want to get to know my system a bit better!

I totally empathise with these sentiments and I think the unix style directory structure is long over-due for rationalization and simplification as it is designed for corporate networks with dumb terminals and not applicable to personal devices... and it's just confusing and inconvenient. I like the software packages to be installed as self contained enitities and not spread all over the place.

p.s. if you want to get a feel for the how things are organized try the command

I don't know if this is "standard" but at my job where most of us have Solaris or Linux desktops, /bin and /usr/bin are local to each box while /usr/local/bin (and other dirs under /usr/local) are NFS mounted from a server that holds binaries for various variants of the OSes. So it's *not* local despite the name. This is to ease administration of upgrades etc.