# Moving around: cd

Course: Terminal Basics — https://zero2vibecode.com/learn/terminal-basics
Canonical URL: https://zero2vibecode.com/learn/terminal-basics/1-2-moving-with-cd

`cd` walks you into a folder, `cd ..` walks you back out, and `cd ~` teleports you home. Three moves cover the whole disk.

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 prompt 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.

## 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 ../..
```

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.

## Several steps at once

A path 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".

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:

1. `cd projects`
2. `cd website`
3. `pwd` — confirm you are in `/home/user/projects/website`
4. `cd ..` — back up to `projects`
5. `cd ~` — home again

Watch the prompt change at each step. That changing prompt is the reason you rarely need `pwd` once you have the habit.
