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, thendocuments/hello.txtworks
- If you're in