• Home
  • Python
    • Introduction to Python
    • Python Developer
  • JavaScript
    • Introduction to JavaScript
    • JavaScript Developer
  • React.js
    • Introduction to React
    • React Developer
  • TypeScript
    • Introduction to TypeScript
    • TypeScript Developer
  • Linux Shell
    • Introduction to the Linux Shell
    • Linux Shell Developer
  • C++
    • Introduction to C++
    • C++ Developer
  • C Language
    • Introduction to C
    • C Developer
  • Rust
    • Introduction to Rust
    • Rust Developer
  • Zig
    • Introduction to Zig
    • Zig Developer
  • Interactive Training
  • Pricing
  • Brainstorm
STEMTrainingGrounds
  • Courses
    • Home
    • Python
      • Introduction to Python
      • Python Developer
    • JavaScript
      • Introduction to JavaScript
      • JavaScript Developer
    • React
      • Introduction to React
      • React Developer
    • TypeScript
      • Introduction to TypeScript
      • TypeScript Developer
    • Linux Shell
      • Introduction to the Linux Shell
      • Linux Shell Developer
    • C++
      • Introduction to C++
      • C++ Developer
    • C Language
      • Introduction to C
      • C Developer
    • Rust
      • Introduction to Rust
      • Rust Developer
    • Zig
      • Introduction to Zig
      • Zig Developer
  • Interactive Training
  • Pricing
  • Navigate
    • Home
    • Reading Grounds
    • Brainstorm

Quick Links

  • About Us
  • Pricing
  • Partnership
  • Brainstorm
  • Terms
  • Privacy
  • Refunds

Courses

  • Python
    • Introduction to Python
    • Python Developer
  • JavaScript
    • Introduction to JavaScript
    • JavaScript Developer
  • React
    • Introduction to React
    • React Developer
  • TypeScript
    • Introduction to TypeScript
    • TypeScript Developer
  • Linux Shell
    • Introduction to the Linux Shell
    • Linux Shell Developer
  • C++
    • Introduction to C++
    • C++ Developer
  • C Language
    • Introduction to C
    • C Developer
  • Rust
    • Introduction to Rust
    • Rust Developer

Newsletter

Subscribe to our free monthly newsletter, for a quick update on Python, JavaScript, and React news

© 2025 - 2026 STEMTrainingGrounds. All Rights Reserved.

Introduction to the Linux Shell -

Lesson 4 of 23

Lesson Progress: 0%

Lesson Progress: 0%
Lesson Incomplete
← Previous: Linux cd command
Lesson 4 of 23
Next: Linux mv command →

The pwdcommand stands for "print working directory" and is one of the simplest yet most useful commands in the Linux shell. When you run it, the shell displays the full absolute path of the directory you are currently in. This is especially helpful when you are navigating through folders and lose track of where you are. Unlike other commands that take flags or arguments, pwd is typically used by itself and always returns a single line: the path to your current location. Learning to use pwd regularly will help you stay oriented in the filesystem and build confidence as you explore new directories.

  • pwd prints the full path of your current working directory, starting from the root /.
  • When you first open a terminal, you are usually in your home folder, and pwd shows that location.
  • The output is always an absolute path — it begins with a forward slash and never depends on context.
  • If you ever feel lost, typing pwd is the quickest way to figure out where you are.
  • Try typing pwd now to see what directory you are currently in.
  • This time you are inside a subfolder called Documents instead of your home folder.
  • Running pwd here shows /home/user/Documents, the full path that includes every directory from root down to your current folder.
  • Each part of the path separated by / is one level in the directory tree.
  • You can see how each cd move changes what pwd reports.
  • Type pwd to confirm that you are indeed inside the Documents folder.
  • You are now in the /tmp directory, a common location for temporary files.
  • The /tmp directory is one level below root, so its absolute path is short — just /tmp.
  • Every directory in the system, no matter how deep, has a unique absolute path thatpwd will reveal.
  • Notice how the path changed compared to the previous task — you moved somewhere completely different.
  • Run pwd to see that you are now in /tmp.
  • This task starts you in /var, another standard system directory.
  • System directories like /var, /etc, and /tmp are all part of the Linux filesystem hierarchy.
  • Running pwd in different system folders helps you learn the standard layout of a Linux system.
  • The pwd command works exactly the same way in every directory — it always prints the absolute path.
  • Type pwd to see that your current directory is /var.
  • This time you are in /etc, a directory that holds system configuration files.
  • Even though the path is short (/etc), it is still a complete absolute path starting from root.
  • Understanding where system directories like /etc are located helps you become a more confident Linux user.
  • The pwd output is always predictable and reliable — you can trust it to tell you exactly where you are.
  • Run pwd to verify you are in /etc.
  • You are now inside /home/user/Downloads, a subfolder of your home directory.
  • This path has three levels: / (root), home, user, and then Downloads.
  • Every time you use cd to move somewhere new, running pwdafterward confirms the move worked.
  • Using pwd regularly builds good habits and prevents you from accidentally running commands in the wrong directory.
  • Type pwd one more time to confirm you are in the Downloads folder.

Test Incomplete

What does pwd stand for?

Question #

1/15

Score

0/0 - 0.0 %

Task Incomplete
Example
~$ pwd
  • Run pwd to see your current working directory
Linux Shell
~$
Task Incomplete
Example
~$ pwd
  • Run pwd to see your current location
Linux Shell
~/Documents$
Task Incomplete
Example
~$ pwd
  • Run pwd from /tmp
Linux Shell
/tmp$
Task Incomplete
Example
~$ pwd
  • Run pwd from /var
Linux Shell
/var$
Task Incomplete
Example
~$ pwd
  • Run pwd from /etc
Linux Shell
/etc$
Task Incomplete
Example
~$ pwd
  • Run pwd from Downloads
Linux Shell
~/Downloads$