topics/06-file-system

The File System

No C:\ drive, no D:\ drive. Linux organizes everything into a single tree that starts at one root. Once you know the main branches, you'll never get lost.

One tree, one root

Every file and folder on a Linux system lives somewhere under / — called the root directory (not to be confused with the root user — same word, different thing!). Other drives, USB sticks and network shares are mounted into the tree as folders, instead of getting their own letters like in Windows.

Analogy: Windows is a parking lot where every drive gets its own letter. Linux is a single airport — everything connects to one terminal, each drive is just another gate inside it.

Absolute path (starts from /)

/home/alex/Documents/report.pdf — the full address, works from anywhere. Like a postal address.

Relative path (from where you stand)

If you're in /home/alex, then Documents/report.pdf points to the same file. Like saying “two doors down”.


visual/directory-tree

The tree, visualized

The seven branches every beginner should know — explained in more detail below.

  • /root — the top of everything
    • /homeevery user's personal files
      • /home/alexyour stuff: Documents, Downloads, Pictures…
    • /etcsystem-wide configuration files
    • /varthings that grow: logs, caches, databases
    • /usrinstalled programs & shared resources
    • /binessential commands (ls, cp, mv…)
    • /tmptemporary files, wiped on reboot
    • /rootthe root user's private home — locked
bash — peek at the root yourself
alex@pc:~$ls /bin  boot  dev  etc  home  lib  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var

tree/branches

Each branch, in plain words

/home — your personal space

Each user gets a folder here (/home/alex). Your documents, downloads, pictures and most app settings live inside. You have full rights here — this is where you'll spend 99% of your time. The shortcut ~ always means “my home folder”.

/etc — the settings room

System-wide configuration files in plain text: hostname, network settings, what services start at boot. Readable by everyone, writable only by admin — which is why tweaking it needs sudo.

/var — the growing pile

Data that constantly changes: log files (/var/log), package caches, website content on servers, print queues. When something misbehaves, the clues are usually in a log here.

/usr — where programs live

Most installed software and their shared resources (icons, libraries, documentation) land here — e.g. binaries in /usr/bin. Historically “user” programs; today: read-only system resources.

/bin — the essential toolbox

The core commands from the Terminal topic — ls, cp, mv, cat — are programs living here. (On modern systems /bin is usually a link into /usr/bin.)

/tmp — the scratchpad

Temporary files for everyone. Anything dropped here may vanish at reboot — perfect for downloads you're about to delete anyway, terrible for anything precious.

/root — the admin's private office

The root user's home folder. Unlike /home, it's locked to normal users — try ls /root and you'll get a polite “Permission denied”.

…and a few bonus branches

/dev represents your hardware as files · /proc & /sys are live windows into the kernel · /mnt & /media are where USB drives appear · /boot holds the bootloader and kernel.

Rule of thumb: your files → /home. System settings → /etc. Problems & logs → /var/log. Everything else → leave it alone until you know it.
Finished this topic?

Saved locally in your browser — no account needed.