zlacker

[return to "Understanding the bin, sbin, usr/bin, usr/sbin split (2010)"]
1. IgorPa+Vp[view] [source] 2026-01-04 16:33:32
>>csmant+(OP)
Also /bin vs /sbin believe is that the latter is meant for statically linked binaries such that if your system is corrupted these at least will keep working.

Practically in this century if I was starting a new OS I would set it up like so:

/bin for all system binaries. Any binary from a package installed by the OS package manager lived here.

/lib same but for shared libraries

/var for variable data. This is where you would put things like your Postgres data files.

/tmp for temporary files.

/home as usual.

/dev as usual.

/boot as usual

/etc as usual

/usr would be what /usr/local is on most systems. So /usr/bin is binaries not installed by the OS package manager. /usr/etc is where you put config files for packages not installed by the package manager and so on.

Get rid of /usr/local and /sbin.

/media replaces /mnt entirely (or vice versa).

Ditch /opt and /srv

Add /sub for subsystems: container overlays should live here. This would allow the root user (or a docker group, etc.) to view the container file system, chroot into it, or run a container on it.

Then again, nobody gave me a PDP-11 to decide so my vote doesn’t count :)

◧◩
2. buzer+4E[view] [source] 2026-01-04 17:57:17
>>IgorPa+Vp
> Also /bin vs /sbin believe is that the latter is meant for statically linked binaries such that if your system is corrupted these at least will keep working.

My understanding is that sbin for system binaries, not necessarily statically linked. Normally /sbin is only in root's PATH, not normal user's. They are likely world executable, but in many cases you cannot actually run them as non-root since they usually touch things only root can access without special access (e.g. raw devices, privileged syscalls, /etc/shadow etc.). Not always though, like you can run /sbin/ifconfig as normal user in read-only mode.

◧◩◪
3. IgorPa+SN[view] [source] 2026-01-04 18:58:26
>>buzer+4E
The s in sbin stood for static initially. Of course nowadays this is not enforced.
[go to top]