Joshua
Joshua

Reputation: 26722

Windows equivalent to UNIX pwd

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

Upvotes: 509

Views: 618335

Answers (12)

Fazal Haroon
Fazal Haroon

Reputation: 1163

It will show you the current path in the console, use the below command

echo %cd%

enter image description here

Upvotes: 2

samivic
samivic

Reputation: 1310

You can just type

cd

it will return you the current path.

Upvotes: 7

Bugmenot
Bugmenot

Reputation:

Use the below command

dir | find "Directory"

Upvotes: -2

user4350567
user4350567

Reputation: 321

cd ,

it will give the current directory

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

Upvotes: 28

phuclv
phuclv

Reputation: 41764

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

Upvotes: 2

scripter
scripter

Reputation:

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

Upvotes: 0

Petar Kabashki
Petar Kabashki

Reputation: 6628

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

Upvotes: 626

Roy Tinker
Roy Tinker

Reputation: 10152

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.

Upvotes: 17

Mastereve
Mastereve

Reputation: 1

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.

Upvotes: -5

Fernando
Fernando

Reputation: 335

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.

Upvotes: 30

sean e
sean e

Reputation: 11925

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.

Upvotes: 0

Daniel A. White
Daniel A. White

Reputation: 190925

It is cd for "current directory".

Upvotes: 175

Related Questions