In this article, we will discuss:
- What is pwd command in Unix
- Windows equivalent of Unix pwd command
- Bonus Tip: Use cd command to change directory
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:
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:
Example 2: Change directory
Our current directory is C drive, which can be changed to D drive by executing the command below:
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.