What is the difference between /bin, /usr/bin and /sbin?
/bin and /usr/bin hold commands every user can run; /sbin and /usr/sbin hold system administration tools such as fdisk or iptables. On modern distributions /bin is a symlink to /usr/bin, so the old split between them no longer exists in practice.
Explain it simply
Historically, /bin held the few commands needed to boot and repair a system (ls, cp, sh), while /usr/bin held everything else, because /usr could sit on a separate disk mounted later. /sbin and /usr/sbin were the same idea for administrator commands.
Most current distributions (Ubuntu, Fedora, Debian, RHEL) have merged these: /bin is just a symlink to /usr/bin, and /sbin to /usr/sbin. So the practical difference left is user tools versus admin tools, and even that is blurred because ordinary users can run many sbin commands for read-only purposes.
Locally installed software usually goes to /usr/local/bin, which keeps it separate from what the package manager owns.
Example
ls -ld /bin /sbin
# lrwxrwxrwx 1 root root 7 ... /bin -> usr/bin
# lrwxrwxrwx 1 root root 8 ... /sbin -> usr/sbin
which ls
# /usr/bin/lsWhat to say in the interview
"Originally /bin was for boot-critical commands and /usr/bin for the rest, with /sbin for admin tools. Today most distros merge them with symlinks into /usr. Custom-installed software goes in /usr/local/bin so it doesn't clash with packaged files."
Common mistakes
- Believing /bin and /usr/bin are always separate folders with different contents.