Skip to content
zero2vibecodelearn vibe coding
Level 1 · Files, folders, paths 5 min Reviewed by the author · Oct 22, 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%
In this lesson

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

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

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

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?

The full path of the folder you are currently in — `pwd` stands for print working directory. It answers exactly one question: where am I.

What does `ls` show?

The files and folders inside your current folder — `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?

Plain `ls` does not say — you find out by trying to `cd` into it, or by using a flag — 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.

Commands in this lesson

Terms in this lesson

Move between lessons with ← → · search with ⌘K

Written and reviewed by Mikhail Kuzmitskii