Windows: pwd with forward slashes, not back?
Could anyone tell me how I can print the current working directory with forward slashes, not backslashes, from the Windows command line?
Thanks!
UPDATE: preferably I would like to do this without downloading any special utilities, but that may not be possible.
2 Answers
You can do substitutions like this:
C:\WINDOWS\System32>echo %CD:\=/%
C:/WINDOWS/System32 2 You could download GNU utilities for Win32 and use sed.
pwd | sed -e 's!\\!/!g'
c:/Windows
Disclaimer, I don't have a windows PC in front of me to test this, but I have used sed on windows to solve similar problems.
2