Beginner · 3 min · practise every command in the built-in terminal

pwd — Print Working Directory

pwd tells you exactly where you are in the filesystem.

pwd

Output example:

/home/student

This is your current working directory. Every command you run is executed relative to this location.

Why does this matter?

Imagine you have files in /home/student/documents and files in /home/student/projects. Knowing where you are helps you reference the right files.

Absolute vs Relative Paths

  • Absolute: Always starts with / — works from anywhere
    • /home/student/documents/hello.txt
  • Relative: Based on where you currently are
    • If you're in /home/student, then documents/hello.txt works

Practice tasks

  1. Print your current working directory
  2. Navigate into documents/ and confirm your new location
  3. Go back to your home directory and confirm with pwd
  4. Print your working directory and count its characters with wc

Commands in this lesson

Navigation