Windows equivalent to UNIX pwd

WindowsCmdPwd

Windows Problem Overview


How do I find the local path on windows in a command prompt?

Windows Solutions


Solution 1 - Windows

This prints it in the console:

echo %cd%

or paste this command in CMD, then you'll have pwd:

(echo @echo off
echo echo ^%cd^%) > C:\WINDOWS\pwd.bat

Solution 2 - Windows

It is cd for "current directory".

Solution 3 - Windows

Open notepad as administrator and write:

@echo %cd%

Save it in c:\windows\system32
with the name "pwd.cmd" (be careful not to save pwd.cmd.txt)

Then you have the pwd command.

Solution 4 - Windows

cd ,

it will give the current directory

D:\Folder\subFolder>cd ,
D:\Folder\subFolder

Solution 5 - Windows

cd without any parameters is equivalent to pwd on Unix/Linux.

From the console output of typing cd /?:

Displays the name of or changes the current directory.

[...]

Type CD without parameters to display the current drive and directory.

Solution 6 - Windows

You can just type

cd

it will return you the current path.

Solution 7 - Windows

In PowerShell pwd is an alias to Get-Location so you can simply run pwd in it like in bash

It can also be called from cmd like this powershell -Command pwd although cd or echo %cd% in cmd would work just fine

Solution 8 - Windows

hmm - pwd works for me on Vista...

Final EDIT: it works for me on Vista because WinAvr installed pwd.exe and added \Program Files\WinAvr\Utils\bin to my path.

Solution 9 - Windows

C:\Documents and Settings\Scripter>echo %cd%
C:\Documents and Settings\Scripter

C:\Documents and Settings\Scripter>

for Unix use pwd command

Current working directory

Solution 10 - Windows

Use the below command

dir | find "Directory"

Solution 11 - Windows

You can simply put "." the dot sign. I've had a cmd application that was requiring the path and I was already in the needed directory and I used the dot symbol.

Hope it helps.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJoshuaView Question on Stackoverflow
Solution 1 - WindowsPetar KabashkiView Answer on Stackoverflow
Solution 2 - WindowsDaniel A. WhiteView Answer on Stackoverflow
Solution 3 - WindowsFernandoView Answer on Stackoverflow
Solution 4 - Windowsuser4350567View Answer on Stackoverflow
Solution 5 - WindowsRoy TinkerView Answer on Stackoverflow
Solution 6 - WindowssamivicView Answer on Stackoverflow
Solution 7 - WindowsphuclvView Answer on Stackoverflow
Solution 8 - Windowssean eView Answer on Stackoverflow
Solution 9 - WindowsscripterView Answer on Stackoverflow
Solution 10 - WindowsBugmenotView Answer on Stackoverflow
Solution 11 - WindowsMastereveView Answer on Stackoverflow