Menu
Coddy logo textTech

Home And Root Directory

Part of the Fundamentals section of Coddy's Terminal journey — lesson 8 of 82.

Two of the most important directories in any Unix-based filesystem are the root directory and the home directory.

Root Directory (/)

The root directory is the top of the entire filesystem. Every file and folder on your system lives somewhere inside it. It is represented by a single forward slash:

cd /

From the root, you can reach any location on the system using an absolute path.

Home Directory (~)

The home directory is your personal space in the filesystem. It is where you start when you open a new terminal session. It is represented by the tilde symbol:

cd ~

You can always return to your home directory from anywhere using cd ~ or simply cd with no arguments:

cd

Comparing root and home:

  • / — the root of the whole system. Everyone shares it.
  • ~ — your personal home directory. It usually lives at /home/username.

Think of the root as the entire building, and your home directory as your own room inside it.

You can always check where ~ points to by running:

echo ~
challenge icon

Challenge

Beginner

Navigate to the root directory using cd /, then confirm your location with pwd.

Hint: The root directory is represented by a single /. After navigating there, pwd should output just /.

Cheat sheet

The root directory is the top of the entire filesystem, represented by /:

cd /

The home directory is your personal space in the filesystem, represented by ~:

cd ~

You can also return to your home directory using cd with no arguments:

cd

Key differences:

  • / — the root of the whole system (shared by everyone)
  • ~ — your personal home directory (usually at /home/username)

To check where ~ points to:

echo ~

Try it yourself

Terminal
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Fundamentals