Skip to content
ohsudo, Home

Module 1: First steps

Find your way around: pwd, ls and cd

Everything on Linux lives in one tree of folders, and your terminal is always somewhere in it. These three commands tell you where you are, what's there, and how to move.

● Runs 100% in your browser. Nothing here can harm a real system.

Step 1 of 8

Where are you?

pwd prints the folder you're in, as a full path from the root of the tree, /.

Your task

Print the folder you're in.

guest@ohsudo: ~ — Ubuntu 24.04

Starting the terminal…

What you'll practice

  1. Where are you?. pwd prints the folder you're in, as a full path from the root of the tree, /.
  2. What's here?. ls lists what's in the current folder.
  3. Hidden files. A name starting with a dot is hidden from a plain ls. Configuration files are often hidden. -a shows all of them, and adding -l shows details such as permissions and sizes.
  4. Go into a folder. cd changes the folder you're in. Your prompt shows where you ended up.
  5. Go back up. .. always means the folder above this one.
  6. Jump anywhere. A path starting with / is absolute: it works from anywhere. Logs live in /var/log on nearly every Linux system.
  7. The system log. Debian and Ubuntu write general system messages to a file called syslog. RHEL, Rocky and AlmaLinux write general system messages to a file called messages, not syslog as on Debian and Ubuntu.
  8. Go home. ~ means your home folder, and a plain cd takes you there too.

See also