Home

What is a HOME Directory?

When you use a computer, especially a Linux or Mac computer (but Windows has something similar), you usually have a user account. Just like every person in a house might have their own room, every user on a computer gets their own space—this is their HOME directory.

HOME directory

This is simply a folder where all your stuff (your documents, music, pictures, configuration files, etc.) is kept. It helps keep everyone’s files separate and organized.

For example:


What is ~ (Tilde)?

The tilde symbol (~) is a shortcut. Instead of typing out your full HOME directory path (like /home/alice), you can just use ~ in the command line. For example:

cd ~

will take you straight to your HOME directory no matter what your username is.


What is the HOME Environmental Variable?

Environmental variables are like little signs or labels that the computer uses to keep track of information.

The HOME environmental variable is a special variable that stores the path (the location) of your HOME directory. So, if your HOME directory is /home/alice, then:

You can see what yours is by typing:

echo $HOME

This will print the location of your home directory.


How Do HOME and ~ Relate?

Put simply:


Summary

So, when you type cd ~, the computer looks up the HOME environmental variable to figure out where to send you