Workstation topics · Gentle Linux and the command line

Lesson 2 of 3 · about 25 minutes

Finding your way: where am I, what's here, go there

🏠The everyday picture

Imagine walking through a big office building blindfolded, with a friend who answers three questions: "Which room am I in?", "What's in this room?" and "Take me to the next room". With those three, you can reach anywhere. The terminal gives you exactly those three questions.

📘What it really is

Question Command Example
Where am I? pwd (print working directory) /home/asha
What's here? ls (list) Documents Downloads notes.txt
Go there cd (change directory) cd Documents

Some helpers:

📝A worked example

$ pwd
/home/asha
$ mkdir shop
$ cd shop
$ pwd
/home/asha/shop
$ ls
$ cd ..
$ pwd
/home/asha

The $ is the prompt: the terminal waiting for you. You don't type it. ls inside the new, empty shop folder printed nothing, which is correct: there's nothing there yet.

🖱️Try it

  1. Type pwd to see where you start.
  2. Make a folder called practice, go into it, and check with pwd.
  3. Inside it, make two folders, photos and letters, then type ls to see them.
  4. Go back up with cd ... Then type cd prac and press Tab: the terminal finishes the name for you.

✅Quick check

You type cd Letters and get "No such file or directory", but ls shows letters. Why?

Show the answer

Linux names are case-sensitive. Letters and letters are different, so type the name exactly: cd letters.

You're lost deep inside folders. Which command takes you straight home?

Show the answer

cd ~, or just cd on its own.

🧩Check yourself

Tap an answer to see why every option is right or wrong. There's no score and nothing is saved, so try as often as you like.

1. You've just logged in to a server. Which command tells you which folder you are in?

2. You're in /home/asha/shop/letters. You type cd ... Where are you now?

3. A tutorial says to type cd Projects, but your folder is called projects. What happens?

← PreviousWhat Linux is, and where you'll meet it
ProLearners Assist