# Where am I: pwd and ls

Course: Terminal Basics — https://zero2vibecode.com/learn/terminal-basics
Canonical URL: https://zero2vibecode.com/learn/terminal-basics/1-1-pwd-and-ls

`pwd` tells you which folder you are standing in and `ls` shows what is inside it. These two answer every "where am I" question you will ever have.

Files live in folders, and folders live inside other folders. In the terminal you are always standing inside exactly one of them, called the **current folder** (or *working directory*, which is the same thing in longer words).

Everything you type happens relative to that spot. Two commands keep you oriented.

## pwd — where am I?

`pwd` stands for *print working directory*. It prints the full path from the top of the disk down to where you are standing:

```
/home/user
```

Read that left to right: a folder called `home`, and inside it a folder called `user`. That second one is your home folder — the same place the prompt shows as `~`.

A path is just a set of directions, with `/` between each step. `/home/user/projects` means "from the top, go into home, then user, then projects". The very first `/` is the root of the whole disk.

## ls — what is here?

`ls` is short for *list*. It shows what is inside the current folder:

```
downloads  notes.txt  projects  todo.txt
```

Two folders and two files, sorted alphabetically. Note what `ls` does *not* show you: what is inside `notes.txt`. Reading files is a different job for a different command, coming in level 2.

## Looking somewhere else without moving

`ls` takes an optional argument: a folder to look inside.

```
ls projects
```

That shows the contents of `projects` while you stay exactly where you are. Handy when you want a peek before deciding to go in.

Two useful flags here. `ls -a` also shows hidden files — the ones whose names start with a dot, like `.git`. `ls -l` prints one per line, which is easier to read when a folder is crowded. You can look either of them up any time with `man ls`.

## Try it

The terminal beside this lesson starts you in your home folder, with a couple of files and folders already there.

Run them in order:

1. `pwd` — see where you are standing.
2. `ls` — see what is around you.

Then, if you like, try `ls projects` to look inside a folder without stepping into it.

Get this pair into your fingers. When you open a terminal in an unfamiliar project — or when an AI agent hands you one and says "run this here" — `pwd` and `ls` are how you check that "here" is the place you think it is.
