Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In follow-up to the cmd.exe question, what is the PowerShell equivalent to echo %cd%, or Linux/Unix pwd?

share|improve this question
up vote 16 down vote accepted

PowerShell has many of the same commands as Linux. pwd is the command equivalent.

When you type pwd in Powershell, it is an alias to Get-Location.

share|improve this answer
"that was easy" .. boy do I feel sheepish :) – warren Jun 9 '11 at 14:03

In addition to Get-Location and its Aliases, you can also use the automatic variable $pwd.

The $pwd variable is nice because you have direct access to the PathInfo members. E.g.


And if you ever want to know what members there are you can just pipe the command\alias to Get-Member :

PS C:\Users\your-name-here\Desktop> pwd|Get-Member

   TypeName: System.Management.Automation.PathInfo

Name         MemberType Definition
----         ---------- ----------
Equals       Method     bool Equals(System.Object obj)
GetHashCode  Method     int GetHashCode()
GetType      Method     type GetType()
ToString     Method     string ToString()
Drive        Property   System.Management.Automation.PSDriveInfo Drive {get;}
Path         Property   System.String Path {get;}
Provider     Property   System.Management.Automation.ProviderInfo Provider {get;}
ProviderPath Property   System.String ProviderPath {get;}
share|improve this answer
very cool! I need to find a good tutorial introduction to PowerShell – warren Jun 9 '11 at 14:04
Hover over the Powershell tag in your question. Click the FAQ link. Look at the second item in the list. – EBGreen Jun 9 '11 at 14:19

Get-Location cmdlet should do the trick

As Thiago mentioned, you can use these aliases: gl or pwd

share|improve this answer

It's pwd. You can "stringify" it by putting it in the quotes. More so, you can build up paths like so: "$pwd\bin".

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .