Windows OS

Windows Equivalent of Unix pwd Command

If you are a Unix user who switched to Windows, then you might face some difficulties in using the Windows Command Prompt (CMD) because the Unix commands are different as compared to Windows in terms of syntax. Similarly, pwd is a command in Unix utilized to output the full path of the current directory and its file name. This can be executed in Unix without any hassle. However, if you are struggling with finding the file path in Windows, then you should know the Windows equivalent of the Unix pwd command.

In this article, we will discuss:

Let’s go through each of the mentioned points one by one!

What is pwd Command in Unix?

pwd” is the short form of the (print working directory) in Unix systems. This command is used to output the path in which the user is present. It is one of the built-in commands of the Unix shell. Its output comprises slashes, where the first /(slash) represents the root directory while the current directory is the last name shown at the end of the directory path.

Windows Equivalent of Unix pwd Command

The equivalent of pwd in Windows is the “cd” command. It stands for the “change directory” and displays the path in which the user is present right now. Moreover, the cd command is also utilized to move between the directories.

Now, let’s head towards using the cd command in Windows.

Example: Show Current Working Directory Using cmd

To check the current working directory in Windows, you need to execute the cd command in Windows Command Prompt.

Open “Command Prompt” from the “Start menu”:

Now, run the given “cd” command:

> cd

As you can see, the path of the current working is displayed on the cmd:

Bonus Tip: Use cd Command to Change Directory

Windows cd command can also be utilized to change or move to another directory. In this section, we have provided some bonus examples for a better understanding of the cd command.

Example 1: Move to Root Directory

Run the “cd\” command to move to the root directory:

> cd\

Example 2: Change directory

Our current directory is C drive, which can be changed to D drive by executing the command below:

> cd d:

We have discussed the Windows equivalent of Unix pwd command.

Conclusion

The Windows equivalent command to Unix pwd is the cd command. Both of these commands share identical features. However, the cd command can also change or move to another directory. This manual discussed the cd command as the Windows equivalent of the Unix pwd command and provided some examples related to its usage.

About the author

Sharqa Hameed

I am a Linux enthusiast, I love to read Every Linux blog on the internet. I hold masters degree in computer science and am passionate about learning and teaching.