Skip to content
zero2vibecodelearn vibe coding
Level 1 · Files, folders, paths 5 min Reviewed by the author · Aug 4, 2026

Where am I: 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.

Level 1 · 0 / 4 lessons0%

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 , 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 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 shows as ~.

Note

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.

Quick check

The terminal printed /home/user/projects. Which command did you just run?

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.

Tip

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.

Quick check

Why would you run ls -a instead of plain 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.

Tip

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.

Check your understanding

Answered 0/3
Mode:

What does `pwd` print?

What does `ls` show?

You run `ls` and see `projects`. Is that a file or a folder?

Finish the task in the terminal and answer the questions to complete the lesson.

📝 My notes

Saved automatically in this browser · shows up on the Notes page.

Task

Find out where you are with pwd, then look around with ls.

Tab complete · history · Ctrl+L clear · help commands

  • Not done: Ask where you are with pwd
  • Not done: Look around with ls
  • Not done: pwd prints your full path

Lesson Q&A

What does `pwd` print?

`pwd` stands for print working directory. It answers exactly one question: where am I.

What does `ls` show?

`ls` is short for list. It lists what is in a folder — names only, not what is inside the files.

You run `ls` and see `projects`. Is that a file or a folder?

Names with no extension are usually folders, but that is a guess, not a rule. The terminal will tell you for sure the moment you try to enter it.

The terminal printed /home/user/projects. Which command did you just run?

pwd prints a path. ls prints a list of names. cd moves you and stays silent about it.

Why would you run ls -a instead of plain ls?

Dot-files like .git and .env are hidden from plain ls. In a project folder they are often the ones you are looking for.

Move between lessons with · search with ⌘K