most of the apps have their executables in /usr/bin and other files also in the generally defines folders..

But i found some apps keep their executeables elsewhere...Now as in linux any file can be executeable the file can actually be placed anywhere..

But for achieving proper segrigation and stuff which locations have been defined as the ones that should be preferably be used for various files of an app?

Is there any specification for it as such?


3 Answers 3


Specific to Ubuntu, even though FHS is followed, there are specific policies for applications depending on how they are submitted.

If the application is submitted for inclusion in the universe or multiverse repositories you must follow the policy as governed by how you are submitting the application (either through Debian first or directly to Ubuntu).

If the application will be submitted via MyApps for inclusion in the paid software or extras repository they must conform to the Extension policy. Basically, the application must be installed to and run from /opt/<appname>. You can save information to the users home directory and those locations vary depending on what you are saving (settings should be saved in ~/.config/<appname>), etc. This follows freedesktop.org standards.


The UNIX/Linux file hierarchy has a long history and there are many standards for it.

Filesystem Hierarchy Standard (FHS) defines which directory shall be used for what perpose.

FHS is the main standard in Linux-based systems and is used by Linux Standard Base (LSB), which is followed by many Linux distributions.


This actually relates to File System Hierarchy Standard. Even if you consider using your own application , for achieving its better integration based on its customized segregation , it is defined in /opt : Add-on application software packages as

The directories /opt/bin, /opt/doc, /opt/include, /opt/info, /opt/lib, and /opt/man are reserved for local system administrator(USER) use. Packages may provide "front-end" files intended to be placed in (by linking or copying) these reserved directories by the local system administrator, but must function normally in the absence of these reserved directories.

Programs to be invoked by users must be located in the directory /opt//bin or under the /opt/ hierarchy. If the package includes UNIX manual pages, they must be located in /opt//share/man or under the /opt/ hierarchy, and the same substructure as /usr/share/man must be used.

Package files that are variable (change in normal operation) must be installed in /var/opt. See the section on /var/opt for more information.

Host-specific configuration files must be installed in /etc/opt. See the section on /etc for more information.

No other package files may exist outside the /opt, /var/opt, and /etc/opt hierarchies except for those package files that must reside in specific locations within the filesystem tree in order to function properly. For example, device lock files must be placed in /var/lock and devices must be located in /dev.

Distributions may install software in /opt, but must not modify or delete software installed by the local system administrator without the assent of the local system administrator.

Following this format for custom applications is better supported by the Ubuntu /Linux system .Further ..

Rationale or Fundamental Reason behind it

The use of /opt for add-on software is a well-established practice in the UNIX community. The System V Application Binary Interface [AT&T 1990], based on the System V Interface Definition (Third Edition), provides for an /opt structure very similar to the one defined here.

The Intel Binary Compatibility Standard v. 2 (iBCS2) also provides a similar structure for /opt.

Generally, all data required to support a package on a system must be present within /opt/, including files intended to be copied into /etc/opt/ and /var/opt/ as well as reserved directories in /opt.

The minor restrictions on distributions using /opt are necessary because conflicts are possible between distribution-installed and locally-installed software, especially in the case of fixed pathnames found in some binary software.

The structure of the directories below /opt/ is left up to the packager of the software, though it is recommended that packages are installed in /opt// and follow a similar structure to the guidelines for /opt/package. A valid reason for diverging from this structure is for support packages which may have files installed in /opt//lib or /opt//bin

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