How to Find Your Current Directory in Linux Using pwd

In a graphical operating system, you always know where you are. You can look at the top of the File Explorer window to see your current location (e.g., C:\Documents\Work), and you can see a list of files below. The Linux terminal, however, is a text-only interface. If you have been changing directories (using the cd command) for thirty minutes, diving deep into system configuration folders, your command prompt might just say user@server:~$, giving you absolutely no visual clue about your current location. If you execute a script or delete a file without knowing exactly which directory you are sitting in, you could cause catastrophic damage to the system. To find your bearings instantly, you must use the pwd command.

What Does ‘pwd’ Actually Mean?

The acronym pwd stands for Print Working Directory. In Linux terminology, your “working directory” is the specific folder you are currently “inside” of. The term “print” simply means to display text on the screen. Therefore, the command literally means “Display the folder I am currently inside.”

Step-by-Step: Using the Command

This is arguably the simplest command in the entire Linux ecosystem, as it requires no flags or arguments.

  1. Open your Linux terminal.
  2. Type the letters: pwd
  3. Press Enter.

Understanding the Output

The terminal will instantly print a single line of text directly below your command. This line is your Absolute Path.

  • Example Output: /var/www/html/wp-content/themes

This output tells you exactly how deep into the hard drive you are. It means you are inside the “themes” folder, which is inside the “wp-content” folder, which is inside the “html” folder, which is inside the “www” folder, which is inside the “var” folder, which sits at the very root (/) of the entire hard drive.

With this information, you can now safely use the ls command to view the files around you, or use relative paths (like cd ../..) to back out of the deep folder structure confidently.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.