AI Hints
Home›Linux Tutorial›Files and Folders
Linux · Lesson 14 of 120

pwd: Where Am I?

Your current folder.

⏱ 2 min read▶ Video at 15:20🎓 Free
Watch this lesson in the Linux courseWatch on YouTube ↗Full Linux course

In the terminal, you're always standing inside one folder. It's called your current folder, or working directory. Every command you run starts from there. So the first question to ask is, where am I?

pwd: Where Am I?
From the video: pwd: Where Am I?
  • You're always inside a folder
  • Called the working directory
  • Where am I?

PWD stands for print working directory. It prints the full path of the folder you're in. When you open a terminal, you start in your home folder, slash home slash sam.

Terminal
pwd
/home/sam

Reading a path

A path is like an address in the tree. Read it from left to right. Start at the root. Go into home. Then into sam. Each slash separates one folder from the next. So slash home slash sam means the sam folder, inside home, inside the root.

/start at the root
homethen into home
samthen into sam
/home/samSam's home folder

Home, and the tilde

Your home folder is special. It's where you have permission to create anything you like. Because you use it so often, it has a shortcut. The tilde sign. That's why the prompt shows a tilde when you're at home. Tilde, and slash home slash sam, mean exactly the same place.

keyvalue
Home folder/home/sam
Shortcut~
~ in the promptyou're at home
Yoursyou can create anything here

Summary

PWD prints where you are, as a full path. Your home folder is slash home slash sam, or tilde for short. Next, how to see what's inside a folder.

Key takeaways
  • pwd: where am I
  • /home/sam
  • ~ means home
Next up: ls: What Is Here? — listing a folder