Kahibaro
Discord Login Register

`/usr`

What `/usr` Is (and Is Not)

/usr is one of the largest and most important directories on a Linux system. Historically it meant “user,” but on modern systems it’s better to think of it as:

The place for shareable, read‑only system-wide data and programs.

In contrast:

On many systems /usr can be on its own partition and even mounted read‑only once the system is running, because it doesn’t contain machine‑specific variable data (that belongs in places like /var or /etc).

Typical Layout Inside `/usr`

While distributions may vary slightly, you’ll usually see at least these subdirectories:

We’ll look at what each is for and how you’ll encounter them as a beginner.

`/usr/bin` — Main User Programs

/usr/bin is the primary directory for user‑facing commands installed by the distribution. These are programs that regular users run in their shell, from text editors to network tools.

Typical examples you might find here:

Some systems put many core utilities directly in /usr/bin and use symbolic links so that /bin points into /usr/bin. You don’t have to worry about the detail, but it’s useful to know that:

You can confirm this with:

which ls

`/usr/sbin` — System Administration Programs

/usr/sbin contains system administration tools and daemons that are not typically needed by ordinary users.

Examples:

Most commands in /usr/sbin either require sudo or are only useful to administrators.

Note: Like /usr/bin, some systems unify /sbin and /usr/sbin with symlinks.

`/usr/lib` — Shared Libraries and Support Files

/usr/lib (and its architecture-specific variants like /usr/lib64 or /usr/lib/x86_64-linux-gnu) stores shared libraries and internal data used by programs.

Examples:

As a beginner you usually don’t manipulate /usr/lib directly. It’s mostly managed automatically by your package manager.

Key idea: if a program in /usr/bin is the surface, /usr/lib is the underlying machinery that makes it work.

`/usr/share` — Architecture-Independent Data

/usr/share holds files that do not depend on CPU architecture. These are shared, read‑only data files used by many programs.

Common contents include:

As a desktop user, many of the icons, themes, and menu entries you see are loaded from /usr/share.

`/usr/local` — Locally Installed Software

/usr/local is reserved for software that is installed locally by the system administrator, outside of the distribution’s normal package management.

Typical use cases:

Structure inside /usr/local often mirrors /usr:

This separation is useful because:

As a beginner, you’ll mostly encounter /usr/local if you follow guides that have you compile software from source.

`/usr/include` — Header Files for Development

/usr/include contains C/C++ header files and other development headers.

Examples:

These are used when compiling programs. If you install “-dev” or “-devel” packages, they typically put files here.

If you later learn to compile programs, the compiler will automatically look in /usr/include for these headers.

`/usr/src` — Source Code (Optional)

/usr/src is a place where source code is often stored:

Not all systems use /usr/src heavily, but you may see it mentioned in tutorials about kernel modules or custom drivers.

`/usr/libexec` (and Similar) — Internal Program Helpers

On some distributions (notably Fedora, RHEL, and related), you’ll see /usr/libexec. This directory contains internal helper programs that:

Examples:

On other distributions (like Debian/Ubuntu), the same purpose may be served by subdirectories under /usr/lib.

As a beginner, you rarely need to touch these, but you might see their paths show up in logs or error messages.

`/usr/games` and `/usr/local/games`

Some older or traditional setups use /usr/games for games and recreational programs that are part of the distribution, and /usr/local/games for locally installed games.

Modern distributions may place games directly in /usr/bin instead.

How `/usr` Relates to Other Directories

Without repeating other chapters, here are a few key relationships to keep straight:

Practical Things You’ll Do Involving `/usr`

As a beginner, you won’t often manually modify /usr, but you will:

  which nano
  ls /usr/bin | head

Remember: anything under /usr should normally be considered owned by the system’s package manager, except for /usr/local, which is yours to customize.

Views: 21

Comments

Please login to add a comment.

Don't have an account? Register now!