The Filesystem Hierarchy Standard specifies where Linux distributions should place files.
bin directories contain executables intended to be used by any user, while
sbin directories contain executables intended to be used only by the system administrator.
sbin directories are normally only in root's
/sbin) contain programs that are needed early in the boot process, because
/usr could be mounted on a separate partition (even though this is rare nowadasy).
/usr/sbin) contain programs that are provided by the distribution, and that are not in
/sbin. On a typical system, a large majority of executables are in
/usr/local hierarchy is the realm of the administrator. The directories
/usr are normally reserved to the distribution, and generally contain only files provided by the system package manager.
/usr/local (and in particular
/usr/local/sbin) are untouched by the package manager, so this is where the local administrator may place executables installed manually.
/usr/games may contain executables that are provided by the distribution and considered purely recreational. It's largely a historical survivance (a long time ago,
/usr/games might be off-limits at certain times of the day, but this kind of practice — which was easy to work around anyway — has died down).
Other common executable locations on Linux system include:
/usr/bin/X11 for X programs. The practice of separating X programs from non-X programs has died down; nowadays they all live in
/usr/bin/mh for executables of the MH email client, which manipulates emails through single-purpose shell commands (
show to display a message,
forw to forward a mail, …) Only MH users would put
/usr/bin/mh in their
/opt/bin, if it exists, would contain symbolic links to applications installed in
The rules for Linux are inspired by general guidelines followed by most unix systems, but each unix variant has its own quirks. For example:
- On *BSD,
/usr contain only the core of the distribution: basic services and applications that are maintained directly by the distribution maintainers. Third-party programs (“packages” or “ports”) are installed in
/usr/local, even if they are managed by a package manager. There is no commonly-accepted separate location for programs provided by the system administrator.
- Some unix systems have no
/bin directory, it's a symbolic link to
- Some systems may have extra directories containing optional package, each of which puts its own
bin directory in the
- Some systems may have extra directories which may or may not be placed on the
$PATH depending on what the execution environment should be compatible with, for example
/usr/xpg6/bin for compatibility with POSIX/Single Unix, or
/usr/ucb for compatibility with legacy BSD systems.