0
0
Linux CLIscripting~2 mins

pwd (print working directory) in Linux CLI - Commands & Configuration

Choose your learning style9 modes available
Introduction
Sometimes you need to know exactly where you are inside your computer's folder system. The pwd command shows you the full path of the folder you are currently working in. This helps you avoid confusion when moving or running files.
When you open a terminal and want to confirm which folder you are in before running commands.
When you are navigating through many folders and want to check your current location.
When writing scripts that need to know the current folder path to work correctly.
When troubleshooting file path errors to ensure you are in the right directory.
When you want to record or share your current folder location with others.
Commands
This command prints the full path of the current directory you are in. It helps you know exactly where you are in the folder structure.
Terminal
pwd
Expected OutputExpected
/home/user
Key Concept

If you remember nothing else, remember: pwd tells you the exact folder path you are working in right now.

Common Mistakes
Trying to use pwd with extra arguments like 'pwd foldername'
pwd does not accept arguments; adding them causes an error or unexpected behavior.
Simply type 'pwd' without any extra words or options.
Confusing pwd with ls to list files.
pwd only shows the current folder path, it does not list files inside it.
Use 'pwd' to see your location and 'ls' to see files in that location.
Summary
The pwd command shows the full path of your current working directory.
It helps you confirm your location in the folder structure before running other commands.
Use pwd without any arguments to get the current directory path.