Vol. I · No. 46The command line sectionSat, 10 Oct 2026
The system itself

/bin

everyday commands→ usr/bin

/bin is where the everyday commands are found. The name is short for binaries — programs ready to run. ls, cp, cat and the shell itself are all here, and on a current system /bin is simply a link that points at /usr/bin.

Type a command, and the shell finds it here.

Holds
Commands
Programs any user may run
On disk
A link
Points to usr/bin on current systems
Who writes
Package manager
Not a place for your own scripts
Name
Binaries
Executable programs

Why it exists

Every directory at the top of the tree is there for a reason. This is the problem /bin solves.

Commands needed before /usr existed

On early Unix machines /usr was a separate disk, mounted late. /bin held the few commands needed to boot and to repair the system before that disk was available.

Why it is now a link

Modern systems mount everything early, so the split no longer helps. /bin was merged into /usr/bin and left behind as a link, so that scripts beginning #!/bin/sh still work.

How the shell finds a command

The shell searches the directories listed in the PATH variable. /usr/bin is on that list, which is why ls runs without typing its full path.

What you find inside

Not everything, but the entries worth recognising. Each is marked as a directory, a file, a link or a device.

/bin
  • bashfileThe shell that reads what you type.
  • lsfileLists the contents of a directory.
  • cpfileCopies files and directories.
  • catfilePrints the contents of a file.
  • grepfileFinds the lines in a file that match a pattern.
  • shlinkA link to the system’s default script shell.

At the terminal

Four commands that show what this directory is doing on a real machine.

ls -ld /bin

Show that /bin is a link, and where it points.

echo $PATH

List the directories the shell searches for a command, in order.

which bash

Show the full path of the program a command name runs.

file /bin/ls

Show what kind of file a command is — a compiled program or a script.

Handle with care

What goes wrong here, and what someone securing or attacking the machine looks at.

Do not add your own scripts here

Personal scripts belong in ~/bin or ~/.local/bin, and system-wide ones in /usr/local/bin. Files placed in /bin get mixed up with the system’s own.

A changed binary is a warning sign

An attacker who replaces ls or ps can hide files and processes. Package tools such as dpkg --verify or rpm -V compare the installed files against what the package shipped.

Read alongside