← All lessons
Files and permissions · Lesson 1 of 7

The file tree

Windows has a tree per drive (C:, D:). Linux has a single tree starting at /, and extra disks and USB sticks are attached somewhere inside it, often under /media or /mnt. Attaching a disk to a folder is called mounting it.

The folders at the top are the same on nearly every Linux system:

/home    each user's own folder: /home/sam
/root    the administrator's home
/etc     settings for the system and its programs
/usr/bin most programs (/bin is often a link to it)
/var     things that change: logs in /var/log, websites, databases
/tmp     scratch space, cleared on restart
/dev     devices: disks, the terminal, /dev/null
/proc    live information about running programs

Settings are plain text files under /etc. /etc/hostname holds the computer's name and /etc/hosts maps names to network addresses. Changing how the system behaves is very often a matter of editing one of these files.

"Everything is a file" is an old Linux idea. Disks, the terminal and even running programs show up as files you can read, which is why the same small tools (cat, grep, less) work on so much.

Linux file names are case-sensitive (Notes.txt and notes.txt are two files) and can hold almost any character except /. Spaces are allowed but awkward on the command line, so many people use dashes or underscores.

Practice

Where do system-wide settings files usually live?

More info

Quick reference

/home/nameYour files.
/etcSettings, as text files.
/usr/binPrograms.
/var/logLogs.
/tmpScratch space, cleared on restart.
/dev, /procDevices; running programs.
/media, /mntWhere extra disks are mounted.

The other Linux courses