Skip to the workspace
Pebellslearn by building
Navigation Basics  ›  Capstone Project

The Directory Hierarchy — One Tree from /

Directory Hierarchy Overview 15 minLinux has one directory tree rooted at /, with conventional branches such as /etc for configuration, /var for changing data, /usr for programs and /home for users.

linux / The Directory Hierarchy — One Tree from /

Explore each scene at your own pace.

01 · The rule

The rule

The Directory Hierarchy — One Tree from /

On Windows you might think in drive letters: C:, D:. Linux has no drive letters. Every file on every disk hangs off a single tree that starts at /, called the root. Once you know what the main branches are for, you can guess where almost anything lives without searching.

The rule

One tree, one root: every path starts at /.

The top-level directories follow a shared convention, so they look much the same on most Linux systems:

Directory What lives there
/home one folder per user: /home/asha
/root the home folder of the root (administrator) user
/etc system-wide configuration files, mostly plain text
/var data that changes as the system runs: logs in /var/log, caches, mail queues
/usr installed programs and their files: /usr/bin, /usr/lib, /usr/share
/bin, /sbin essential commands; on most modern systems these just point into /usr
/tmp temporary files, often cleared at reboot
/opt optional, self-contained software packages
/boot the kernel and the files needed to start the system
/dev devices shown as files, such as disks (/dev/sda)
/proc a live view of running processes and kernel information, generated in memory
/mnt, /media places where extra disks and USB drives are attached

A second disk doesn't get a new letter. It is mounted onto a directory, such as /mnt/backup, and from then on its files look like any other part of the tree.

$ ls /
bin  boot  dev  etc  home  lib  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.