Skip to main content

Unit 1 · What is Linux? · Lesson 4 of 34

File System Fun

File System Fun

Just like every other OS, Linux organizes everything using a file and directory based system called a file system. Think of it like a tree:

  • Branches → directories
  • Leaves → files

Directories can contain both files and other directories. Everything starts at the root, written as /, which is where all directories sit on top of.

Root Directory Structure

/
├── bin
├── boot
├── dev
├── etc
├── home
├── lib
├── media
├── mnt
├── opt
├── proc
├── root
├── run
├── sbin
├── srv
├── sys
├── tmp
├── usr
└── var

Each of these directories stores a specific group of files needed for Linux to operate. You don't need to memorize all of them, but here are the ones you'll run into the most in this course:

DirectoryWhat's in it
/homeEvery user's personal folder lives here (yours is /home/user)
/rootThe home folder for the root user, the admin of the whole system (more on root later!)
/etcSettings and config files for the system and its programs
/bin and /usrThe programs themselves, including the commands you'll be typing
/tmpTemporary files that get wiped out regularly
/varStuff that changes a lot, like log files
/optExtra software that didn't come with the system
/devYour devices (hard drives, keyboard, etc.) show up here as files. Yes, really.
/procInfo about the programs running right now

Do this lesson for real

With a free account you get the terminal, the challenges and the checks that go with every lesson in Intro to Linux, and your progress is saved as you go. CyberAcad is a 501(c)(3) nonprofit, so there is nothing to pay.