Windows equivalent to UNIX pwd

你离开我真会死。 提交于 2019-11-26 18:46:33

问题


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


回答1:


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



回答2:


It is cd for "current directory".




回答3:


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.




回答4:


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.



回答5:


cd ,

it will give current directory

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



回答6:


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.




回答7:


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




回答8:


Use the below command

dir | find "Directory"



回答9:


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




回答10:


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.



来源:https://stackoverflow.com/questions/921741/windows-equivalent-to-unix-pwd

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!