You know where you are. Now move.
cd — change directory
cd takes one argument: where you want to go.
cd projects
You are now inside projects. The updates to show it, and ls from here lists a different set of names.
Notice that cd printed nothing. That is not a glitch — it is the Unix convention: tools stay quiet when they succeed and only speak when something goes wrong. If you ever see output from cd, read it, because it is an error.
Quick check
You run `cd projects` and nothing is printed. What happened?
Going back up: ..
Every folder contains a hidden entry called .. that means “the folder above me”.
cd ..
From /home/user/projects that puts you back in /home/user. Chain it to go up further:
cd ../..
Note
There is also ., which means “the folder I am in right now”. It looks useless until you meet commands that need to be told a target explicitly — cp file.txt . means “copy it right here”, and git add . means “everything in this folder”.
Going home: ~
cd ~ takes you to your home folder from anywhere, no matter how deep you are. So does plain cd with no argument at all.
cd ~
cd
Both land you in /home/user. This is your escape hatch when you are lost.
Quick check
You are somewhere deep and completely lost. What is the quickest way back to a known place?
Several steps at once
A can name more than one step, separated by /:
cd projects/website
That is the same as cd projects followed by cd website. It also works with ..:
cd ../downloads
means “up one, then into downloads”.
Tip
Press Tab while typing a folder name and the terminal completes it for you. It also refuses to complete names that do not exist, which makes Tab a free spell-checker for paths.
Try it
Take a walk and come back:
cd projectscd websitepwd— confirm you are in/home/user/projects/websitecd ..— back up toprojectscd ~— home again
Watch the prompt change at each step. That changing prompt is the reason you rarely need pwd once you have the habit.
Quick check
From /home/user/projects/website, what does `cd ../notes` do?